[DGD] do lightweight objects duplicate arrays?

Felix A. Croes felix at dworkin.nl
Thu Aug 23 16:05:14 CEST 2001


Thomas Conner Annandale <gte829m at prism.gatech.edu> wrote:

> Say I have a (non-lightweight) object, A, that maintains several arrays of
> data.  A also references a lightweight object.  That lightweight object,
> in turn, references some of the arrays in A.  Are the arrays duplicated at
> the end of the executing thread?

Only if these lightweight objects are exported into the dataspace of a
different persistent object will they be duplicated at the end of the
thread.  At that point, lightweight objects and arrays behave in a
similar fashion.  If a lighweight object is duplicated, the arrays and
other lightweight objects it contains are duplicated also.


> Also, I seem to have some trouble with save_object and restore_object on
> light-weight objects.  Are these functions supposed to work on lightweight
> objects the same as they work on normal objects?

That's a bug.  Lightweight objects should save and restore like normal
objects.


> On a side note, don't you think it would be better to have the contents of
> lightweight objects saved when the object that references them is saved
> (using save_object), since the very existence of the lightweight object is
> dependent on its referrer?

How objects are created and destructed should not matter to save_object().
Or to put this differently, save_object() is hopelessly broken and should
not be depended upon to preserve data that is not all in one object.


> And wouldn't it be better still to just have "struct" functionality?  :P

I think not :-)

Regards,
Dworkin
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list