Version Tolerant Serialization

  • Thread starter Thread starter Dennis C. Drumm
  • Start date Start date
D

Dennis C. Drumm

New for .net framework 2.0 is version tolerant serialization. To use this
new feature, do I also need to use the new generics types for collections,
e.g. SortedList?

Thanks,

Dennis
 
Dennis,

No, you don't. Mind you, you can have version-tolerant classes in any
version of the framework. If you implement ISerializable, and the custom
serialization constructor, then you can determine how tolerant your classes
are.

In .NET 2.0 and above, if you are willing to say that all additions of
fields in the future are optional, then you can use the OptionalField
attribute to indicate that if the field is not in the serialization stream,
then don't throw an exception.

You do not need to use generics for new collections in .NET 2.0. You
can use whatever you wish (that is serializable, of course).

Hope this helps.
 
Back
Top