Storing application state as XML

Ketil Z Malde ketil at ii.uib.no
Thu Jun 17 12:58:57 BST 1999


Hi,

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

	or

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,

-kzm
-- 
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 ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list