473,372 Members | 1,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Serialization versions

I was curious to know if anyone has suggestions about maintaining various
versions of class definitions when using serialization to save data.

Is there a "standard" way of handling backward compatibility with previous
version file structures? I don't have problems within the program itself,
just with loading data from files created with previous versions of the
class definition. It seems that if a change as minor as changing a property
name, even if the value type and behavior remain the same, it's no longer
compatible with files created using the previous structure.

Here's what my original plan was:

1. Incorporate the version information into the file names (In this program
all files are managed automatically through the program and the user really
never uses the file name)

2. Create a new class definition each time I need to modify the class,
leaving the previous versions of the class definition in tact. The new
definition would have a modified class name to reflect the version.

3. Use the appropriate class definition when reading in the data and perform
any conversions required at that time.

4. Save the file using the latest class definition and modify it's name to
reflect the change.

This seems like a lot accounting of work, am I missing something obvious?
I'll end up with quite a few versions of the class definition used in this
program to store the data. Is it unusual to use serialization to save and
retrieve data this way? Unfortunately it's very difficult right now to nail
down the final class structure as request for new capabilities are handled
and incorporated into the program.

Any comments and/or suggestions are greatly appreciated.

Jul 21 '05 #1
0 804

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
by: Alexander | last post by:
When i store rule on PC with .NET.SP1 i cant restore them from PC without SP1. An i get this Error: System.Runtime.Serialization.SerializationException: Possible Version mismatch. Type...
by: mdb | last post by:
I have a class (very simple int type data, as shown below) that I have serialized to disk. In my next version of the program, I have added some variables to that class. I'm expecting that this...
by: Harold Howe | last post by:
I am having a problem deserializing objects from a library when the following conditions exist: 1- The library is strongly named 2- The serialized file was created with version 1.0 of the...
by: Zachary Turner | last post by:
Hello, I have a situation where I would like to perform custom serialization and deserialization of an existing .NET framework object (specifically, System.DateTime). Is there a common paradigm...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.