Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Externalization?

 
Anil Vupputuri
Ranch Hand
Posts: 527
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the diff b/w Serialization and Externalization,At what occasion Externalization can be useful.As in Serialization ,Serialized object can be deserialized and does the same thing applies to Externalization ???
-Anil
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Externalization takes serialization one step further. <code>Externalizable</code> is an interface that extends <code>Serializable</code>. Classes can implement <code>Externalizable</code> interface and gain the fine-grain control over the way the object gets serialized by overriding <code>readExternal(ObjectInput in)</code> and <code>writeExternal( OjbectOutput out )</code> methods.
During serialization, if the class implements <code>Externalizable</code>, then the overridden methods are called. On the otherhand, if the class implements only <code>Serializable</code>, you'll get the plain vanilla object serialization.

Ajith
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic