Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::serializationinreal-timewithoutallocating memory
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-09-21 14:27:59


Stefan Strasser wrote:
> I think to support this an other use cases like it common_archive
> would have to be moved outside of the linked library into a header
> and be made more generic.

common_archive is a template - it's not in the linked library.

> right now it's full-blown type-registering/object-tracking,
> object-graph with class-hierarchy serialization, or nothing - write
> your own archive from scratch.

Hmmm - seems to me that that this thread shows the opposite.

Also note, that since the "higher level" functionality is mostly implemented
in templates, you (mostly) don't generate code for those functions
that your archive class doesn't use.

> I've also had my problems with that. although I didn't have to avoid
> allocation completely, the construction of a common_archive took too
> long and you couldn't configure away the parts you don't need.

I would like to see improvements in this area. Mostly this is because
I would like to see the library more "formal" and hence with less bugs,
more robust, and more extensible. It's not been a huge priority since
most users find the the archive classes included in the package seem
addequate to their needs.

> such a generalization could be based e.g. on what is described as
> "levels of sophistication" of serialization, here:
> http://www.parashift.com/c%2B%2B-faq-lite/serialization.html#faq-36.2

I looked at this and found it to be very unhelpful and misleading
two those who want to actually implement serialization. The items
really address the tradeoffs in implementing a serialization system.
I don't think that that these items consider the power of C++
combined with things like other boost libraries. Anyone following
this advice would endup writing new serialization code for every
application - exactly the wrong direction to go. It also also lacks
and notion of good design - factoring data types from algorithms
(text vs binary discussion). Any user following this advice would
without at least taking a hard look at the boost serialization library
would be wasting tons of his employers money at a minimum. It
might even be considered by some to be a breach of professional
ethics - unless he didn't know better in which case I suppose it would
be excusable.

Robert Ramey


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net