Posts

Showing posts from October, 2012
Serializable Vs Externalizable Serialization       It is the technique using which we can save the state of the Object into files,or we can transfer the object from 1 jvm to another jvm. To Serialize the object,its class must implement Serializable interface.But Serializable interface  has some serious drawbacks1.Lets Assume the class Hierarchy Object->A->B->C->D    (child class) If you serialize the D class object,then all its superclass objects are also serialized(saved into file), which might be unnecessary sometimes.Not only the fields and properties are serialized,but also the class information,and their metadata is also serialized. 2.Assume Your class D has 100 fields/properties,out of which you are intrested to serialize only 5. Are you going to declare all other 95 fields as transient to avoid serialization?This is another issue. You really dont have any control on what you want to serialize and want you dont want to serialize. 3.You have serialized o