Storing application state as XML

Ketil Z Malde ketil at
Thu Jun 17 12:58:57 BST 1999


I must admit I don't have the time to follow this list as diligently
as I'd like, so it is possible that my questions have been answered
already.  I'll submit them nevertheless. :-)

We have a rather complex application which stores its state using the
standard MFC serialize stuff (well, actually a somewhat hacked
version, but that's beside the point).  Now, this limits our freedom
in (or at least severely complicates) redesigning internal class
structure while maintaining backwards file compatibility, and we've
been pondering an XML format instead.

There are of course other advantages, like accessing the information
from other applications, or generating HTML and whatnot.

The question is whether this, in general, is a good idea, and whether
people have done this, and if so, to what degree of success, and by
what methods.

I can see two ways of doing this:

1) Use a DOM-based document, which can be passed around, much the way
a CArchive class is, and modifying the Serialize() to fill in the
relevant nodes in the document tree


2) Encapsulating the document (DOM or otherwise) in a separate class,
which traverses the application's classes and picks whatever
information is relevant in whatever sequence it desires.

The advantage of model 1 is a structure quite similar to what already
exists, most of the code base could be left alone, I think.

On the other hand, if our existing classes are well designed, all the
relevant information should be accessible through the public:
interfaces, and it should be easier to build the document in a
flexible way.  E.g. the placement of various information might not be
obvious from the class' perspective.

So, before we jump the gun, I'd like to hear from people who have done 
this, and are willing to share their experiences, or otherwise
contribute suggestions and ideas.

Thanks for listening,

If I haven't seen further, it is by standing in the footprints of giants

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list