Boost logo

Boost :

From: John Harris (TT) (john.harris_at_[hidden])
Date: 2002-03-19 10:33:58


I don't know what's going on with the lists, or which one I should post to,
but here are my comments about serialization.

--- In boost_at_y..., "rameysb" <ramey_at_r...> wrote:
> Fellow programmers
>

Hi. I've done a bit of work on a custom solution to serialization in my
company; so I'm delighted to see some interest in standardization.

One thing that was crucial to us was 'hookability'. For instance, I would
want to be able to intercept/replace various points in the persistence
engine. I'm thinking specifically about compression, encryption, output
format (e.g. XML, already mentioned by someone) and byte-ordering.

My original version had a canonical byte-order format, but it was desired to
forgo byte-reversal for speed purposes when we didn't care about
portability. A library should make this 'policy' optional.

Another thing I put in my library was the ability to 'serialize' any type to
an ostream in *printable* form, for logging/debugging. This necessitated
heavy use of macros for the serialization functions, but is super handy for
debugging. The code that moves members to a file is the same code that
prints them on a "for printing" ostream.

Lastly, I think your versioning idea is a good one. I'm eager to look at
the code (my company blocks .zip files - so...tomorrow) to see how you did
this. In my implementation, I have the 'stream' set to a particular
'version context', which class implementors can detect and act on
appropriately (e.g. transfer member, 'x', only if in a 7.0 version context)

john harris
trading technologies int'l


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