|
Boost Users : |
Subject: Re: [Boost-users] [Serialization] Writing an old version of a class
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-07-15 19:34:03
Noah Roberts wrote:
> On 7/15/2011 5:27 AM, Don wrote:
>> I apologize if this is a duplicate posting. I sent this 2 days ago,
>> and it appears in the archives, but I never received it back from
>> the list and there have been no replies, so I am posting it again.
>>
>> Using boost serialization, I would like to be able to write an old
>> version of a class, so that I can save data in an "old" format to
>> allow other users with an old version of my program to read the file.
>>
>> I see from the archives that this has come up before, and Robert
>> Ramey indicated it was doable and on the todo list, but I don't see
>> it in the release notes or documentation. Did anything every come of
>> this?
>
> As far as I had been informed, backward compatibility in writing was
> never planned for the serialization library and was never even planned
> to be planned.
That's exactly true. But I did look into it and much to my surprise
I did conclude that there was no fundamental obstacle - just quite
a bit of work. Enhancing the the serialization library - or even fixing
a bug - is more problematic than with other libraries besides avoiding
breaking interfaces, one needs to be able to read previously created
archives as well. Then there is an issue that implementing this exposes
a few asymetries in the implementation which would also have to
be addressed somehow. All in all quite a job.
> I don't think you'll find a way to do it without
> severely altering the library itself.
It wouldn't be THAT sever - BUT, even a small change has quite
a bit of "ripple effect"
> Personally, I think this is a significantly lacking feature and I'd
> love to see it implemented. If you pull it off, please consider
> sharing.
It never occurred to me that such a thing would ever be useful.
Also it isn't requested very often. I'm not saying that it's
an illegitimate request - just one that no one has found it
so necessary as to actually invest the required effort.
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