Home » Modeling » UML2 » Storing aggregation property in .uml file
|
Re: Storing aggregation property in .uml file [message #522784 is a reply to message #522770] |
Tue, 23 March 2010 22:15 |
|
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>
|
|
| |
Re: Storing aggregation property in .uml file [message #522789 is a reply to message #522784] |
Tue, 23 March 2010 22:17 |
|
I should mention, additionally, that the XMI you showed is in exact
concordance with the in-memory representation, and thus what you would
see using the Eclipse UML2 API to inspect the model.
This is all in agreement with the UML 2.x metamodel.
Cheers,
Christian
On 23/03/10 06:15 PM, Christian W. Damus wrote:
> 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
--------8<--------
|
|
| |
Re: Storing aggregation property in .uml file [message #628337 is a reply to message #522784] |
Tue, 23 March 2010 22:17 |
|
I should mention, additionally, that the XMI you showed is in exact
concordance with the in-memory representation, and thus what you would
see using the Eclipse UML2 API to inspect the model.
This is all in agreement with the UML 2.x metamodel.
Cheers,
Christian
On 23/03/10 06:15 PM, Christian W. Damus wrote:
> 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
--------8<--------
|
|
| | |
Goto Forum:
Current Time: Fri Apr 26 03:16:28 GMT 2024
Powered by FUDForum. Page generated in 0.02946 seconds
|