Rick Hillegas wrote:

> I recommend that you make your class implement java.io.Externalizable.
> That way you can write your own deserialization logic to handle version
> upgrades of your class. Don't rely on java.io.Serializable; it doesn't
> handle versioning and  isn't appropriate for persisting data; as soon as
> you make a change to your class, you won't be able to deserialize old
> versions.

I agree with the recommendation to use, or at least consider,
Externalizable, but I think you are a little harsh on Serializable. If
you follow the guidelines you can modify the class and continue to
deserialize old versions.

http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/version.html#wp6519

Dan.



Reply via email to