serialization

  • Thread starter Thread starter Perecli Manole
  • Start date Start date
P

Perecli Manole

I have a complex structure containing many interrelated class instances that
is the basis data store of my application. I have been using the
soapformatter and/or binaryformatter to serialize the data to a file and it
works great. The problem is that as soon as I make the smallest of structure
changes to any of the members of any class, the whole structure fails to
deserialize back. How do I get the strucuture to deserialize properly for
those members that have not changed. XmlSerializer works a lot like what I
want but I can't it because it does not serialize all data types like the
soap or binary formatters do.

I need to implement backwards compatibility where I don't loose the data
when small structure changes occur.

Perry
 
Depending on what you believ to be "small changes", did you attempted to use
in your special constructor the SerializationInfo.GetEnumerator() method,
then loop on each property and decide whether you can handle it or not based
on property name ?

Notice that this approach would however be at most "weak" as far as
robustness is concerned.
 
Back
Top