By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,368 Members | 1,294 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,368 IT Pros & Developers. It's quick & easy.

Question about Serializing classes

P: n/a
I'm developing a new application and want to use serialization as a way to
save my data.
But as I add new variables to my classes, how will serializing cope with
that?
For example, suppose I have a class called Point which has 2 variables X and
Y.
I save a few jobs (by serializing), and then enhance my application by
adding a Z variable.
How will serializing behave when loading those jobs that were created before
Z was added?

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Simon,
One of the following articles on serialization discusses how to version your
classes using serialization. I implement ISerializable and write a version
tag, then when I read I read the version tag to decide if the "new"
information is present or not.

http://msdn.microsoft.com/msdnmag/issues/02/04/net/
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
http://msdn.microsoft.com/msdnmag/issues/02/09/net/

Hope this helps
Jay
"Simon" <si***@ssm.com> wrote in message
news:eg**************@TK2MSFTNGP12.phx.gbl...
I'm developing a new application and want to use serialization as a way to
save my data.
But as I add new variables to my classes, how will serializing cope with
that?
For example, suppose I have a class called Point which has 2 variables X and Y.
I save a few jobs (by serializing), and then enhance my application by
adding a Z variable.
How will serializing behave when loading those jobs that were created before Z was added?

Nov 21 '05 #2

P: n/a
It certainly does help.

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ed**************@TK2MSFTNGP12.phx.gbl...
Simon,
One of the following articles on serialization discusses how to version your classes using serialization. I implement ISerializable and write a version
tag, then when I read I read the version tag to decide if the "new"
information is present or not.

http://msdn.microsoft.com/msdnmag/issues/02/04/net/
http://msdn.microsoft.com/msdnmag/issues/02/07/net/
http://msdn.microsoft.com/msdnmag/issues/02/09/net/

Hope this helps
Jay
"Simon" <si***@ssm.com> wrote in message
news:eg**************@TK2MSFTNGP12.phx.gbl...
I'm developing a new application and want to use serialization as a way to save my data.
But as I add new variables to my classes, how will serializing cope with
that?
For example, suppose I have a class called Point which has 2 variables X

and
Y.
I save a few jobs (by serializing), and then enhance my application by
adding a Z variable.
How will serializing behave when loading those jobs that were created

before
Z was added?


Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.