Any tips for designing and implementing session file formats with C# and XML?
-
I'm redesigning the way our application saves and restores sessions. Presently it's serializing using SOAPFormatter, and that's not so good. Most importantly, it's not backwards or forwards compatible. So I want to use XML so that the format is forwards-compatible, and future versions of the application are backwards-compatible with older formats. Does anyone have any tips regarding this? Any good techniques or interfaces to use? XmlDocument vs. XmlWriter/XmlReader? Since some of my data involves Rectangle and Point objects, for instance, and Color objects, too, etc., is there a good way to handle that data without having to handle them specially and write extra code for that? XmlSerializer even seems tantalizing because it might be quick and easy, but I'm afraid that it will be too tied to the internal data representation or class/package structures. Thanks!
-
I'm redesigning the way our application saves and restores sessions. Presently it's serializing using SOAPFormatter, and that's not so good. Most importantly, it's not backwards or forwards compatible. So I want to use XML so that the format is forwards-compatible, and future versions of the application are backwards-compatible with older formats. Does anyone have any tips regarding this? Any good techniques or interfaces to use? XmlDocument vs. XmlWriter/XmlReader? Since some of my data involves Rectangle and Point objects, for instance, and Color objects, too, etc., is there a good way to handle that data without having to handle them specially and write extra code for that? XmlSerializer even seems tantalizing because it might be quick and easy, but I'm afraid that it will be too tied to the internal data representation or class/package structures. Thanks!
Hmm, maybe Reflection will somehow help me with the System classes.