Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Storing aggregation property in .uml file
Storing aggregation property in .uml file [message #628335] Tue, 23 March 2010 21:15 Go to next message
Jordi Cabot is currently offline Jordi Cabot
Messages: 7
Registered: March 2010
Junior Member
Hi all,

I was looking at the xml model representation stored in the .uml file for a simple class diagram containing two classes ("whole" and "part") linked by a composite relationship IsPartOf (diamond next to the "whole" side, a "whole" can contain between 3 and "*" parts).

Everything seemed normal until I realized that the "whole" association end had the right name, type and cardinality but no information about the composition. Surprisingly (to me) the information describing that the association is a composition was stored in the opposite association end (the "part" end). See the XML excerpt below.

This does not seem right to me (and in fact, different from the XML/XMI generated by other modeling tools). So, I'd like to know if you think this is correct, and if so why this is done this way. What am I missing?

<packagedElement xmi:type="uml:Class" xmi:id="_OUqi0DYVEd-QwOAQi-R_Aw" name="Whole"/>
<packagedElement xmi:type="uml:Class" xmi:id="_RiS8cDYVEd-QwOAQi-R_Aw" name="Part"/>
<packagedElement xmi:type="uml:Association" xmi:id="_Ue860DYVEd-QwOAQi-R_Aw" name="IsPartOf" memberEnd="_Ue860TYVEd-QwOAQi-R_Aw _Ue861DYVEd-QwOAQi-R_Aw">
<ownedEnd xmi:id="_Ue860TYVEd-QwOAQi-R_Aw" name="whole" type="_OUqi0DYVEd-QwOAQi-R_Aw" association="_Ue860DYVEd-QwOAQi-R_Aw">
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Ue860zYVEd-QwOAQi-R_Aw" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Ue860jYVEd-QwOAQi-R_Aw" value="1"/>
</ownedEnd>
<ownedEnd xmi:id="_Ue861DYVEd-QwOAQi-R_Aw" name="part" type="_RiS8cDYVEd-QwOAQi-R_Aw" aggregation="composite" association="_Ue860DYVEd-QwOAQi-R_Aw">
<upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Ue861jYVEd-QwOAQi-R_Aw" value="*"/>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_Ue861TYVEd-QwOAQi-R_Aw" value="3"/>
</ownedEnd>
</packagedElement>
Re: Storing aggregation property in .uml file [message #628336 is a reply to message #628335] Tue, 23 March 2010 22:15 Go to previous message
Christian W. Damus is currently offline Christian W. Damus
Messages: 789
Registered: July 2009
Senior Member
Hi, Jordi,

In UML2, the aggregation semantics is an attribute of the Property "of"
the the aggregating type. I say "of" in quotation marks because often
the composite end will actually be an owned attribute of the composing
classifier.

That is to say, in terms of your scenario, the 'Whole' class "has" an
association-end 'part' that provides the Parts that a Whole composes.
It is also common that the association will not own the 'part' end, but
the Whole class will own it. But, that is not necessary.

The point is, that the relationship of a Whole to a Part is
characterized as a composite aggregation, so in the UML2 that is
expressed as an attribute of the 'part' association end that navigates
from the Whole to the Part.

HTH,

Christian


On 23/03/10 05:15 PM, Jordi Cabot wrote:
> Hi all,
>
> I was looking at the xml model representation stored in the .uml file
> for a simple class diagram containing two classes ("whole" and "part")
> linked by a composite relationship IsPartOf (diamond next to the "whole"
> side, a "whole" can contain between 3 and "*" parts).
> Everything seemed normal until I realized that the "whole" association
> end had the right name, type and cardinality but no information about
> the composition. Surprisingly (to me) the information describing that
> the association is a composition was stored in the opposite association
> end (the "part" end). See the XML excerpt below.
>
> This does not seem right to me (and in fact, different from the XML/XMI
> generated by other modeling tools). So, I'd like to know if you think
> this is correct, and if so why this is done this way. What am I missing?
> <packagedElement xmi:type="uml:Class" xmi:id="_OUqi0DYVEd-QwOAQi-R_Aw"
> name="Whole"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_RiS8cDYVEd-QwOAQi-R_Aw"
> name="Part"/>
> <packagedElement xmi:type="uml:Association"
> xmi:id="_Ue860DYVEd-QwOAQi-R_Aw" name="IsPartOf"
> memberEnd="_Ue860TYVEd-QwOAQi-R_Aw _Ue861DYVEd-QwOAQi-R_Aw">
> <ownedEnd xmi:id="_Ue860TYVEd-QwOAQi-R_Aw" name="whole"
> type="_OUqi0DYVEd-QwOAQi-R_Aw" association="_Ue860DYVEd-QwOAQi-R_Aw">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_Ue860zYVEd-QwOAQi-R_Aw" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_Ue860jYVEd-QwOAQi-R_Aw" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_Ue861DYVEd-QwOAQi-R_Aw" name="part"
> type="_RiS8cDYVEd-QwOAQi-R_Aw" aggregation="composite"
> association="_Ue860DYVEd-QwOAQi-R_Aw">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_Ue861jYVEd-QwOAQi-R_Aw" value="*"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_Ue861TYVEd-QwOAQi-R_Aw" value="3"/>
> </ownedEnd>
> </packagedElement>
Previous Topic:Unexpected interaction between UML Association#ownedEnds and DeleteCommand - AssocTest.java (1/1)
Next Topic:How to specialize the aggregation for code-generation
Goto Forum:
  


Current Time: Fri Sep 19 01:46:56 GMT 2014

Powered by FUDForum. Page generated in 0.02039 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software