Assume object A has 6 fields, now the object A is serialized, after some time the 3 more fields are added and the object is deserialized.
- Adding of the new fields will create any exception when deserializing.
- How to have a backward compatibility
Assume object A has 6 fields, now the object A is serialized, after some time the 3 more fields are added and the object is deserialized.
.Net has something called "Version Tolerant Serialization" ;)
Check out this easy to understand example on object serialization:
http://programming.flashadventures.com/c-sharp/writing-objects-to-files-serialization/
Generally add a version and implement custom serialization via ISerializable.
Handle appropriate defaults and or throw more appropriate exceptions there.
See here