Showing posts with label serializable. Show all posts
Showing posts with label serializable. Show all posts

Nov 23, 2010

Why i need the serialVersionUID?

Hi,
So many times i have been asked "what's for", "why i need it". It is very that you add this static variable to you class. The reason is simple, run time calculation cost for computing this UID can result in unexpected class exception, performance etc.
The object is needed for serialization process and deserialization.
I recommend you also to read http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html.
Regards,
Dor

IsSerializable

Hi,
Once i was asked by one of our developers, why can't i use the regular Serialzable marker instead of using
IsSerializable.
Simple answer is: You can but, there are several manners that should be take in considerations when doing that.
Better, read Google reference.
Regards,
Dor