Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serializing Object but compatible with newer versions?

Status
Not open for further replies.

Insider1984

Technical User
Feb 15, 2002
132
US
Hi there. I'm using a binary serializer right now and it works great. I'm quite familiar with them and how to decide whether we should/can serialize certain objects out.

Currently we are serializing a collection which contains many core components. The problem we have is that as we serialize out, some programmer might change or add a member variable or it's type (int to double for example). The deserialization fails because of this.

The items and settings we are saving take time and effort to build up. Our end users will kill us if they have to create these again and again each time we need to change the member variables.

I have looked at XmlSerializer so the output is readable and has the ability to change but there are a number of restrictions with them... one is that they do not serialize interfaces which I use generic interfaces quite a bit.

It was now that we decided to see if there is a better way to serialize and deserialize these collections and most importantly make them compatible with future versions if variables vanish, change types or new ones are added.

Currently we have a list of the bare bones variables we need to save and their types, values etc. We thought about creating a sort of "custom serialization" where we just save the bare bones of what we need. It would be more of a programming thing that serialization however.

The thought would be creating a new tool with old or new code and then the program would open a flat file and populate the variables we need with the settings saved to the file. It would certainly work but is not ideal for us.

Any suggestions would be great. Thank you for your time.



=====================
Insider
4 year 'on the fly' programmer
C, C++, C#, MFC, Basic, Java ASP.NET
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top