Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2002-11-18 00:11:59

From: Beman Dawes <bdawes_at_[hidden]>

>Uh... I think one of us must be misunderstanding something about XML. If
>you can represent serialization of some objects as a character based file,
>can't you turn it into dumb XML by wrapping it in
><my_dumb_tag>....</my_dumb_tag>? Perhaps you mean you don't think it is
>possible to define a set of tags that themselves are rich enough to capture
>all possible C++ data structures?

>But so what? You can just supply content directly for any C++ structures
>that don't represent well in the XML tagged style. And we know from
>experience that many C++ data structures can be usefully represented in an
>XML style format.

That may be. But a serialization system has to be able to handle ALL
(not just many) C++ data structures.

> That seems a rigid view of XML. Just think of it as a way to markup the
>output you are already producing to make it a bit easier for other tools to
>work with. Some of the whitespace or other delimiters become tags. If the
>output you are already producing captures various C++ data structures,
>adding XML markup just enhances the already captured data. That's probably
>a dumb way to use the power of XML, but it may be sufficient for
>serialization needs.

Serialization files contain tables of objects, pointers, classes etc in such
a way that even text archives are effectively indeciferable. Of course they
are text files so the are readable, producible by any text reading/writing program.
But such processing would be useful only another program could exploit
the structure of the data. This would be hard to do without the whole
serialization code.

The attraction of XML is that the structure is regular and accessible
to a wide variety of programs thus making data "portable". XML
may have the "escape clauses" that could be used to wrap serialization data, but
doing so would fail to capture the "meaning" of the serialized data
which would defeat the apeal of XML in the first place.

So looked at in this way I might be convinced it was doable, but
then I would be unconvinced it was worth doing.

I must confess I have zero real world experience with XML so I'm not
prepared to stake a hard line on this. It really just mostly intuition
plus having first hand knowledge how difficult it is to map an
arbitray C++ data structure to a byte stream and back.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at