R
Robert Schneider
I would like to serialize some model objects into a file. For that I use the
BinaryFormatter. In order to not serialize the event delegates of those
objects (due to the observer pattern) I have implemented the ISerializable
interface where I use the GetValue and AddValue methods. So I do this
manually. This works fine. However, I see that the amount of model classes
increases. Now I find it anoying to write all those Add/GetValue methods.
It's quite boring and it's error-prone as well.
So my question is if there is another approach. Could it be solved more
elegant? Or what is the standard way to save something into a file?
Note that it is very important to me that I can realize versions. That is,
the model may change and older files must be still loadable (with some
convertions).
Thanks in advance,
Robert
BinaryFormatter. In order to not serialize the event delegates of those
objects (due to the observer pattern) I have implemented the ISerializable
interface where I use the GetValue and AddValue methods. So I do this
manually. This works fine. However, I see that the amount of model classes
increases. Now I find it anoying to write all those Add/GetValue methods.
It's quite boring and it's error-prone as well.
So my question is if there is another approach. Could it be solved more
elegant? Or what is the standard way to save something into a file?
Note that it is very important to me that I can realize versions. That is,
the model may change and older files must be still loadable (with some
convertions).
Thanks in advance,
Robert