[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.uml2] Re: A question about Element#destroy()

Sunny,

Haven't we discussed this before? ;)

I guess the answer depends on exactly what is meant by "destroy". In UML2,
destroying an element (calling the Element#destroy() method) means detaching
it and all of its children from its containing resource, and removing all
external references to those elements. References between elements within
the element's hierarchy (including containment references) are not removed
in the interest of efficiency - and that's also why destroy() is not called
recursively on each element.

Kenn

"Sunny" <sunfire001@xxxxxxxxx> wrote in message
news:bc637ee1e5a75c96527cc38749dc590d$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> The UML2 Superstructure says: "If a composite is deleted, all of its parts
> are normally deleted with it". That is, if a composite element is
> destroyed, all its parts should be destroyed transitively. But why is
> eclipse uml2 NOT implemented in this way?
>
> For example, if a composite's destroy() method is called, it only removes
> itself from its container and breaks the references from outside of its
> containment hierarchy (i.e., all its direct or indirect parts cannot be
> referenced outside of its containment hierarchy after the composite is
> destroyed). However, its part objects are not destroyed (i.e., the
> destroy() methods of its parts are not called).
>
> Thanks in advance for your explanation!
>
> -- Sunny
>