View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] Serializer "bug"

From: Uwe Zdun <uwe.zdun_at_wu-wien.ac.at>
Date: Wed, 17 Sep 2003 10:44:00 +0200

This is rather an unexpected behavior than a bug ...
I think it would be ok, to force a full name for serialize and deepSerialize,
that is, change the method in Serializer.xotcl to:

Serializer instproc serialize {objectOrClass} {
    my [my category $objectOrClass]-serialize [$objectOrClass]
}

can you please check whether that would work in your example?

--uwe

On Tuesday 16 September 2003 22:34, MichaelL_at_frogware.com wrote:
> Since you're getting 1.1 ready...
>
> I ran across a very, very subtle bug. I was using the serializer to
> serialize an obj tree. The topological sorting wasn't quite working for
> one case. In the end, I tracked it down to the fact that I was passing in
> an unqualified name. The sorting routine was in turn using fully qualified
> references as it tried to build the correct ordering, and the mismatch
> meant that it got some orderings for the root object slightly wrong.
> (Basically a few objects were being created before their containers; their
> containers were objects aggregated by the root object.)
>
> In effect, I was using this:
>
> Serializer deepSerialize obj
>
> when I should have been using this:
>
> Serializer deepSerialize ::obj
>
> I don't think you'd be able to reproduce this easily, because it turned
> out to relate to a specific set of objects and relationships. It turns out
> that for other reasons, even when you make this "mistake" the algorithm
> nearly works.
>
> To make this work you'd either have to a) require fully qualified names or
> b) turn a name into a fully qualified name. I don't know enough about Tcl
> internals to say that (b) is a realistic option--but on the face of it it
> doesn't seem like it would be.
>
> Don't know if this helps much. :-)

-- 
Uwe Zdun
Department of Information Systems, Vienna University of Economics
Phone: +43 1 313 36 4796, Fax: +43 1 313 36 746
zdun_at_{xotcl,computer,acm}.org, uwe.zdun_at_wu-wien.ac.at