[DGD] do lightweight objects duplicate arrays?
Thomas Conner Annandale
gte829m at prism.gatech.edu
Thu Aug 23 19:30:41 CEST 2001
> > 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.
I'm confused. Are you saying that MY code is buggy, and that save_object
and restore_object work, or are you saying that save_object and
restore_object are broken, and do not work with lightweight objects? If
the latter is true, do you plan on fixing it?
> > 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.
I think lightweight objects are much more similar (in use, at least) to
the other primitive data types than they are to persistent objects. I may
want to create an Array "object" and use it wherever I might use a
primitive array, just for the added functionality. However, I'm prevented
from doing this because save_object and restore_object will no longer work
on any object that uses Array because those functions ignore objects. A
simple save_object now become a complex chore, and you have to write a
custom save and restore function for each object. A chore made even more
complicated by save_object and restore_object not even working for
lightweight objects (I'm pretty sure they don't). All this would be
avoided if lightweight objects could be saved inside of the same file as
the persistent object that owns them, just like arrays and mappings.
I know that with DGDs great state dump functionality, it might not seem
necessary to support save_ and restore_object at all, but I still think
these functions are useful in a lot of instances, and it'd be great to
have them working. :P~~
Thomas
www.boredatheist.com
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list