Posted by
Eric Ehlers-2 on
URL: http://quantlib.414.s1.nabble.com/Extending-QLXL-and-serialization-issue-tp13901p14018.html
Hello,
On 2013-01-11 16:53, Lapin wrote:
> I have extended QLXL but I have an issue with the serialization.
> When I try to deserialize the object that were created befate the
> update I
> get a stream error (more or less the old object is not recognized).
>
> I have looked into it, and I have found the reason why. When I have
> added
> the new classes, the class_id="251" in the xml object is not the same
> as in
> the previous object.
On 2013-01-11 17:23, Ballabio Gerardo wrote:
> I have run into the same issue.
>
> In the generated xml files, every QLXL object is identified by a
> reference number. If I understand correctly, the numbers are defined
> by the order in which object are registered in the functions called
> by
> registerQlFunctions (see QuantLibXL/qlxl/register/register_all.cpp
> and
> other files in that directory). Whenever you insert a new object in
> the middle of the sequence, all subsequent objects get their numbers
> incremented by one.
That's right. boost::serialization numbers types in the sequence in
which it encounters them. Registering the types in alphabetical order
of group/class ensures that the assignment of IDs is deterministic at
least within any build of a given version of QuantLibAddin.
We had long debates about how to guarantee compatibility across
releases. We considered solutions such as never deleting any types from
the serialization framework, even if the type is deprecated. But even
then you have the problem of existing types changing and so you have to
version each type. It's just a burden of using boost::serialization.
In the end we did not have the resources to tackle the problem, so data
serialized from one version of the library cannot be deserialized by
another.
> I was wondering what could be the implcations of writing a
> name-value-pair
> kind of serialization as in the following article:
Well, you are talking about a nontrivial redesign, hard to give a quick
answer on that one. Please keep us posted if you take it on.
Kind Regards,
Eric
--
===================================================
Eric Ehlers
nazcatech sprl | Brussels |
http://www.nazcatech.be* Distributed computing for pricing analytics
* Use Microsoft Excel as a client to the Grid
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users