Boost logo

Boost Users :

Subject: Re: [Boost-users] Automating Serialization?
From: Stefan Strasser (strasser_at_[hidden])
Date: 2009-11-27 03:35:55


Am Friday 27 November 2009 08:00:12 schrieb Brian Wood:
>
> "runtime field" ?

field that exists only at runtime. I was assuming serialization used for
persistence.
non-serialized field.

>
> >usually when you do want to add a serialized field you'd also want old
> >versions of the file still to be readable, so you end up writing custom
> >(versioned) deserialization code anyway, even if your language has
> > built-in serialization support.
>
> I recommend avoiding the versioning support in Boost Serialization.
> It runs counter to good development practices by averting the type
> system. Consider for example a class called Account that uses
> versioning to support multiple releases of a product. In the usual
> case, later releases will have more fields and added complexity
> than earlier releases. Support then for a client at an early release,
> say 1.1, becomes inefficient since Account is being used to

that's a very specific case. you can use different types for versioning using
boost.serialization.
more often you want the evolved types to handle old files/streams/...

> >code for you, using e.g. OpenC++, GCC-XML, or Doxygen, but I doubt those
> >generated functions would stay there very long.
>
> I'm not exactly sure what you are saying here, but if a user is
> simply improving the names of some of his fields, the functions
> won't stay the same very long. Automating this helps with a

the same as above, that most serialization functions you might want to
generate automatically at the start of a project end up being custom
serialization functions anyway.

> common problem of forgetting to update the serialization
> functions and the compiler then barking. I don't claim though
> that every class should be handled this way. The C++ Middleware
> Writer allows users to turn off the automated generation of
> marshalling functions if that is desired. In my experience, it is
> unusual to turn that functionality off.

I don't want to start anything, but you already spend the better part of your
messages on this list advertising your ebenezer thing, so I don't think we
need yet another discussion about it.


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