Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mdt-uml2.dev] Question about the EMF implementation of the UML metamodel

Hi,

As I'm not sure if any MDT-UML developper is reading the forum, I'm reposting here a question about the choices made by the team in order to implement some containment associations described in the UML 2.4.1 metamodel (original question is here : https://www.eclipse.org/forums/index.php/t/1067539/) :
Hi,

While looking at the UML implementation using EMF I noticed something that I couldn't figure out by myself, so I'm hoping that someone will be able to explain the following :

In the 2.4.1 UML spec, there's a containment association between Element and itself (owner/ownedElement) and there's also one between Package and PackageableElement (owningPackage/packagedElement).
But in the EMF implementation, the first one is modeled as a derived bi-directionnal reference
    <eStructuralFeatures xsi:type="ecore:EReference" name="ownedElement" ordered="false"
        upperBound="-1" eType="#//Element" changeable="false" volatile="true" transient="true"
        derived="true" eOpposite="#//Element/owner">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The Elements owned by this Element.&#xA;&lt;p>From package UML::CommonStructure.&lt;/p>"/>
      </eAnnotations>
      <eAnnotations source="union"/>
    </eStructuralFeatures>
    <eStructuralFeatures xsi:type="ecore:EReference" name="owner" ordered="false"
        eType="#//Element" changeable="false" volatile="true" transient="true" derived="true"
        eOpposite="#//Element/ownedElement">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="The Element that owns this Element.&#xA;&lt;p>From package UML::CommonStructure.&lt;/p>"/>
      </eAnnotations>
      <eAnnotations source="union"/>
    </eStructuralFeatures>
while the second one is modeled as a composition
    <eStructuralFeatures xsi:type="ecore:EReference" name="packagedElement" ordered="false"
        upperBound="-1" eType="#//PackageableElement" containment="true">
      <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
        <details key="documentation" value="Specifies the packageable elements that are owned by this Package.&#xA;&lt;p>From package UML::Packages.&lt;/p>"/>
      </eAnnotations>
      <eAnnotations source="subsets" references="#//Namespace/ownedMember"/>
    </eStructuralFeatures>
So, I was wondering why the difference between those two... It seems to me that both are doing the same thing, but is there any particular reason to chose one approach over the other ? Or did I miss something ?
Thanks for your time,
Patrick Tournet
--
Cordialement,
--
Patrick TOURNET
ptournet@xxxxxxxxxxxxxx
http://www.win-design.com




Avast logo

L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
www.avast.com



Back to the top