[jdom-interest] serialVersionUID

Jason Hunter jhunter at collab.net
Thu Sep 14 02:33:07 PDT 2000


Great post, Peter!

> if you wanted it to change
> when non-compatible changes are made, you might as well leave 
> things as they are. Setting it explicitly in the class is an 
> indication that the class will
> deal with changes on its own 

Well, there's one important benefit to the simple model.  If our
internal data structures don't change but our public interfaces do
(because we add new setters and such), then by assigning an sVUID we
gain what could be called "short-term compatibility", that is
compatibility until the variables change.

> If JDOM classes wanted to support stable long
> term-serialization in a solid way, several changes need to be made, in
> particular, classes should handle their serialization explicitly and
> generally avoid shortcuts like 'defaultWriteObject'. 

Sounds like a potentially useful feature, with no real downside other
than a little extra coding work and maintenance.  What do people think?  
Is serialization important as long-term storage?  Or should we just tell
people to use *XML* as long term storage (a very reasonable
alternative)?

BTW, do any DOM impls support long-term serialization, or would this be
another JDOM extra?

-jh-



More information about the jdom-interest mailing list