[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: ecore:EReference container property

I also like to add some info (from EMF book) about containment attribute in EReference. I think it is useful:

Containment is a stronger type of association that implies a whole-part relationship: an object cannot, directly or indirectly, contain its own container; it can have no more than one container; and its lifespan ends with that of its container. The containment attribute indicates whether an EReference is being used in modeling such a relationship; it is set on the reference from
the whole to the part, that is from the container to the contained object. If the containment relationship is explicitly bidirectional, then the
opposite reference, the derived container attribute is also true.



Regards, Shu


On Thu, 21 Aug 2003 08:05:17 -0400, Ed Merks <merks@xxxxxxxxxx> wrote:

Chris,

EReference.isContainer is transient, volatile, and not changeable.  It's
implemented like this:

public boolean isContainer()
{
EReference theOpposite = getEOpposite();
return theOpposite != null && theOpposite.isContainment();
}

So a reference is a container if its opposite is a containment.


Chris Potter wrote:

Hi All:

Thanks in advance for your help. Is the ecore:EReference container property
for internal use only or obsolete? The ecore model editor shows this
property, however, unlike other boolean properties it appears to be set to
false and is immutable. I am also unable to import an ecore model into an
EMF project if the container property is set (to either true or false) on
any references in the ecore file. If it is still used can someone explain
to me the distinction between the containment and container properties? The
containment property seems to behave appropriately and express the necessary
amount of information describing whether the reference is an intra- resource
or inter-resource reference.


Thanks,
Chris Potter