[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: copyObject: deep or shallow copy?
> > Does Database.copyObject() to a deep copy or a shallow copy?
> deep. (excluding dependent database objects of course)
>
why excluding dependent database objects? couldn't it to a copyObject
on those
recursively
>
> >
> > By way of example:
> >
> > Say I have a three-layer deep graph of database objects that I want to use as a
^^^^^^^^^^^^^^^^
>
> > template. This objects are ititialized and maintained in a "blank" state. I
> > want to do a deep copy of this graph when creating a new instance of an object
> > which contains this graph, but I don't want to get references (and thereby
> > modify) the original "blank" template objects?
> is this graph made of database or ordinary objects?
>
database objects: ProductType -> AttributeGroup -> Attribute.
>
> >
> > Does this make sense? Am I babbling? I don't know...
> >
> > Also, I seem to recall someone saying that copyObject had some performance
> > advantages. Is this correct?
> advantages over what?
>
over createObject.