473,326 Members | 2,813 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,326 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.

Thanks,
Dave
Nov 22 '05 #1
0 654

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

Similar topics

0
by: Dave | last post by:
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...
37
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...
1
by: Mike | last post by:
I'm having a problem with serializing between different versions of classes. I've read the many posts on handling versioning by implementing ISerializable but unforunately we shipped the first few...
2
by: Just D | last post by:
Hi, I need to write a serialization (to XML string) and restoring (from XML string) of a very complicated object. The object uses a few classes, one class has two ArrayLists, etc. The general...
4
by: Alexander | last post by:
There was such problem, At compilation with SP1 (dotnetfx11SP1) On computers without him{it} ÎÅÄÅÓÅÒÉÁÌÉÚÕÀÔÓÑ some objects. For example (System. Collections. Comparer) and together with...
3
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...
4
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...
2
by: Luck | last post by:
Hi, I really need some expert help... please! Basically, I need to serialize a data structure object to a file using SOAP and then load and de-serialize that file in ANOTHER program. When I...
5
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.