No registered users in community xowiki
in last 10 minutes
in last 10 minutes
Re: [Xotcl] info parameters, parameters for all superclasses?
From: Gustaf Neumann <neumann_at_wu-wien.ac.at>
Date: Sun, 03 Dec 2006 13:09:53 +0100
Kristoffer,
The parameter (in newer versions slots) applicable to an object are
determined
by the classes associated with the object. When one wants to serialize the
complete behavior of an object, it is necessary to serialize its classes
with
their dependencies. Since xotcl 1.5.* the old parameter interface is
replaced
by the slots (but keeping the old interface). The definitions of the
slots are
subobjects/subclasses of the class-definitions where they belong to.
Therefore, when a class is serialized via a deep operation,
all "parameter" definitions are automatically included in the serialized
code.
Have a look in xotcl*/library/serialize/Serializer.xotcl
all the best
-gustaf neumann
ps: It is quite trivial to collect all parameter definitions by looping
over the list of associated classes returned by "<obj> info heritage".
However, the parameter definition themselves are pretty useless
without the class definitions.
Kristoffer Lawson schrieb:
> I noticed [info parameters] only returns the parameters for the direct
> class object on which it is called. This actually makes sense and is
> probably the expected behaviour. I just wonder if it might be useful
> to have something in there to request all parameters belonging to a
> certain object, from all its classes and superclasses?
>
> Doable in script, of course, but might be handy for serialisation?
>
> / http://www.fishpool.com/~setok/
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Date: Sun, 03 Dec 2006 13:09:53 +0100
Kristoffer,
The parameter (in newer versions slots) applicable to an object are
determined
by the classes associated with the object. When one wants to serialize the
complete behavior of an object, it is necessary to serialize its classes
with
their dependencies. Since xotcl 1.5.* the old parameter interface is
replaced
by the slots (but keeping the old interface). The definitions of the
slots are
subobjects/subclasses of the class-definitions where they belong to.
Therefore, when a class is serialized via a deep operation,
all "parameter" definitions are automatically included in the serialized
code.
Have a look in xotcl*/library/serialize/Serializer.xotcl
all the best
-gustaf neumann
ps: It is quite trivial to collect all parameter definitions by looping
over the list of associated classes returned by "<obj> info heritage".
However, the parameter definition themselves are pretty useless
without the class definitions.
Kristoffer Lawson schrieb:
> I noticed [info parameters] only returns the parameters for the direct
> class object on which it is called. This actually makes sense and is
> probably the expected behaviour. I just wonder if it might be useful
> to have something in there to request all parameters belonging to a
> certain object, from all its classes and superclasses?
>
> Doable in script, of course, but might be handy for serialisation?
>
> / http://www.fishpool.com/~setok/
>
> _______________________________________________
> Xotcl mailing list
> Xotcl_at_alice.wu-wien.ac.at
> http://alice.wu-wien.ac.at/mailman/listinfo/xotcl