On Wed, May 18, 2005 at 09:04:07PM -0700, Jeremy Boynes wrote:
> David Blevins wrote:
> >
> >I know exactly how much room for error there is as well as the amount
> >forethought and code required to guarantee even a small amout of
> >future compatibility.  Using SUIDs alone does not cut it. I'm not
> >arguing it's impossible, I'm arguing that it's unrealistic and
> >unreliable at best.
> >
> 
> I think you're looking at it backward - without a crystal ball you don't 
> know what future versions of the class will look like. It is the 
> responsbility of the evolved class to handle upgrading older data.

You won't know what order the fields were written to the stream, so unless you 
had the forethought to write them yourself from the get-go, you will be 
extremely limited on what you can do later.  

Even renaming a private variable would be impossible without planning ahead.

> >The major technical difference between xml data and object
> >serialization data is that xml data can still be parsed even if the
> >schema has changed. The same is not true of serialized object data.
> 
> Why? You can parse a stream of bytes as easily as you can parse a stream 
> of characters. Whether you can use the result of the parse will depend 
> on the semantic content of the new infoset - you can create incompatible 
> XML schemas as well.

Simple, a well-formed XML document is always parseable weather or not you 
choose to validate it against the schema.  Changing element name, orders, or 
types can be dealt with later.  This is not the case with object serialization 
where the class metadata is written to the stream and you have no idea what it 
looks like.

You cannot see, use, create, or predict the order of the class metadata written 
to the stream.  I would hardly say it's any comparison to XML Schema.

As I keep saying, with the proper amount of forethought and code, you can get a 
very limited amount of compatibility with serialization between class file 
versions, but it's unrealistic and unreliable at best.

Unless you can convince everyone to do that, this entire thread is moot 
regardless of what you or I think, and our existing system will never serve as 
a reliable way to store configuration data across upgrades or patches.

-David

Reply via email to