Boost logo

Boost :

From: Russell Hind (rh_gmane_at_[hidden])
Date: 2006-04-22 07:57:49


Marcin Kalicinski wrote:
>
> I'm sure you will agree that ptree is different from serialization. If you
> don't agree, read some of quite interesting posts by Ivan Vecerina. The main
> difference is that serialization lib is _only_ about translation of some C++
> structures to/from a string of bytes. This is a huge and complicated task
> that it does very well. But you must have noticed that some people refrained

I agree.

We do use serialization for our data files (via binary archive and
export via xml archives so some people here who use python can browse
through them and load up the interesting bits that they want, without us
having to describe the entire binary format to them).

But for config files, serialization is overkill. We don't want object
tracking and reference counting in config files. We just want
name/value pairs written out, and the extra bonus of a tree structure
here is very useful.

Another difference that we use when writing config files is that if
properties have 'default' values then we don't write those to the file.
  This makes the file very small in most cases as only values that
really do differ between systems are written and it makes it very easy
to see if other values have been specifically over-ridden for some
systems. This is different from object serialization which reads/writes
every item every time. That isn't to say that an archive couldn't be
created that new about default values and didn't write them out, but I
believe that is not what serialization is intended for and I would use
it for that.

Cheers

Russell


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk