Home » Modeling » UML2 » Navigability, ends owned by Association, how to relate ends and associated elements
|
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #470391 is a reply to message #470384] |
Tue, 13 February 2007 15:46 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Thomas,
You cannot guarantee that assoc.getRelatedElements(i) ==
assoc.getMembers(i).
There also may be a different number of items in the related elements
collection than in the members collection. The getMembers() returns items
that are owned members, in addition to imported members and inherited
members amongst others. Also, as you have pointed out, the related elements
is not an ordered collection.
To be honest, I don't know exactly what you mean by "Element-Property pair
of left side ..." . Associations can be involved in n-ary connections.
I think what you are trying to do is figure out how to draw a line between
the Classifier that potentially own the properties of the associations
related elements.
The .getEndTypes() might be helpful or the getNavigableOwnedEnds().
If you are only considering aggregations then only binary associations can
be aggregations.
Hope that helps.
- James.
"Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
news:45D1A32F.5020803@uni-kassel.de...
> Hi all,
>
> I am currently trying to update my code regarding the new (as of UML2
> 2.x) separation of ownership and navigability of association ends. With
> UML2 1.x, my classes always owned the ends, so I did not have
> non-navigability at all. With UML2 2.x I'd like to implement that and
> it seems to me I will have more uniform code when I let the association
> always own the ends and turn on/off navigability. Now I wonder how I
> can relate the ends (Property objects) to the associated Class objects.
> Is there some guarantee that assoc.getRelatedElements(i) "is on the same
> side of assoc as" getMembers(i)? Or, put another way, how do I get the
> Element-Property-pair of the "left"/one side of the assoc and how of the
> "right"/other side? I wonder because I see ordered="false" in the
> javadoc for getRelatedElements() and getMembers().
>
> Thanks, Thomas.
|
|
|
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #470394 is a reply to message #470384] |
Tue, 13 February 2007 16:11 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Thomas,
Assuming you are working with binary associations, the type (element) at
member end 'i' corresponds to
getMemberEnds().get(i).getOtherEnd().getType()...
Kenn
"Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
news:45D1A32F.5020803@uni-kassel.de...
> Hi all,
>
> I am currently trying to update my code regarding the new (as of UML2
> 2.x) separation of ownership and navigability of association ends. With
> UML2 1.x, my classes always owned the ends, so I did not have
> non-navigability at all. With UML2 2.x I'd like to implement that and
> it seems to me I will have more uniform code when I let the association
> always own the ends and turn on/off navigability. Now I wonder how I
> can relate the ends (Property objects) to the associated Class objects.
> Is there some guarantee that assoc.getRelatedElements(i) "is on the same
> side of assoc as" getMembers(i)? Or, put another way, how do I get the
> Element-Property-pair of the "left"/one side of the assoc and how of the
> "right"/other side? I wonder because I see ordered="false" in the
> javadoc for getRelatedElements() and getMembers().
>
> Thanks, Thomas.
|
|
|
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #471169 is a reply to message #470391] |
Wed, 28 February 2007 10:09 |
Thomas Maier Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi James,
sorry, I got lost in details and forgot to describe what I was actually
after. Yes, you are right, I want to draw lines between classes and
only consider binary assocs. Thanks to your and Kenn's reply I was able
to update my code to UML2 2.x. Thanks, Thomas.
James Bruck wrote:
> Hi Thomas,
>
> You cannot guarantee that assoc.getRelatedElements(i) ==
> assoc.getMembers(i).
> There also may be a different number of items in the related elements
> collection than in the members collection. The getMembers() returns items
> that are owned members, in addition to imported members and inherited
> members amongst others. Also, as you have pointed out, the related elements
> is not an ordered collection.
>
> To be honest, I don't know exactly what you mean by "Element-Property pair
> of left side ..." . Associations can be involved in n-ary connections.
> I think what you are trying to do is figure out how to draw a line between
> the Classifier that potentially own the properties of the associations
> related elements.
>
> The .getEndTypes() might be helpful or the getNavigableOwnedEnds().
>
> If you are only considering aggregations then only binary associations can
> be aggregations.
>
> Hope that helps.
>
> - James.
>
|
|
| |
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #588617 is a reply to message #470384] |
Tue, 13 February 2007 15:46 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Thomas,
You cannot guarantee that assoc.getRelatedElements(i) ==
assoc.getMembers(i).
There also may be a different number of items in the related elements
collection than in the members collection. The getMembers() returns items
that are owned members, in addition to imported members and inherited
members amongst others. Also, as you have pointed out, the related elements
is not an ordered collection.
To be honest, I don't know exactly what you mean by "Element-Property pair
of left side ..." . Associations can be involved in n-ary connections.
I think what you are trying to do is figure out how to draw a line between
the Classifier that potentially own the properties of the associations
related elements.
The .getEndTypes() might be helpful or the getNavigableOwnedEnds().
If you are only considering aggregations then only binary associations can
be aggregations.
Hope that helps.
- James.
"Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
news:45D1A32F.5020803@uni-kassel.de...
> Hi all,
>
> I am currently trying to update my code regarding the new (as of UML2
> 2.x) separation of ownership and navigability of association ends. With
> UML2 1.x, my classes always owned the ends, so I did not have
> non-navigability at all. With UML2 2.x I'd like to implement that and
> it seems to me I will have more uniform code when I let the association
> always own the ends and turn on/off navigability. Now I wonder how I
> can relate the ends (Property objects) to the associated Class objects.
> Is there some guarantee that assoc.getRelatedElements(i) "is on the same
> side of assoc as" getMembers(i)? Or, put another way, how do I get the
> Element-Property-pair of the "left"/one side of the assoc and how of the
> "right"/other side? I wonder because I see ordered="false" in the
> javadoc for getRelatedElements() and getMembers().
>
> Thanks, Thomas.
|
|
|
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #588626 is a reply to message #470384] |
Tue, 13 February 2007 16:11 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Thomas,
Assuming you are working with binary associations, the type (element) at
member end 'i' corresponds to
getMemberEnds().get(i).getOtherEnd().getType()...
Kenn
"Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
news:45D1A32F.5020803@uni-kassel.de...
> Hi all,
>
> I am currently trying to update my code regarding the new (as of UML2
> 2.x) separation of ownership and navigability of association ends. With
> UML2 1.x, my classes always owned the ends, so I did not have
> non-navigability at all. With UML2 2.x I'd like to implement that and
> it seems to me I will have more uniform code when I let the association
> always own the ends and turn on/off navigability. Now I wonder how I
> can relate the ends (Property objects) to the associated Class objects.
> Is there some guarantee that assoc.getRelatedElements(i) "is on the same
> side of assoc as" getMembers(i)? Or, put another way, how do I get the
> Element-Property-pair of the "left"/one side of the assoc and how of the
> "right"/other side? I wonder because I see ordered="false" in the
> javadoc for getRelatedElements() and getMembers().
>
> Thanks, Thomas.
|
|
|
Re: Navigability, ends owned by Association, how to relate ends and associated elements [message #593933 is a reply to message #470391] |
Wed, 28 February 2007 10:09 |
Thomas Maier Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Hi James,
sorry, I got lost in details and forgot to describe what I was actually
after. Yes, you are right, I want to draw lines between classes and
only consider binary assocs. Thanks to your and Kenn's reply I was able
to update my code to UML2 2.x. Thanks, Thomas.
James Bruck wrote:
> Hi Thomas,
>
> You cannot guarantee that assoc.getRelatedElements(i) ==
> assoc.getMembers(i).
> There also may be a different number of items in the related elements
> collection than in the members collection. The getMembers() returns items
> that are owned members, in addition to imported members and inherited
> members amongst others. Also, as you have pointed out, the related elements
> is not an ordered collection.
>
> To be honest, I don't know exactly what you mean by "Element-Property pair
> of left side ..." . Associations can be involved in n-ary connections.
> I think what you are trying to do is figure out how to draw a line between
> the Classifier that potentially own the properties of the associations
> related elements.
>
> The .getEndTypes() might be helpful or the getNavigableOwnedEnds().
>
> If you are only considering aggregations then only binary associations can
> be aggregations.
>
> Hope that helps.
>
> - James.
>
|
|
| |
Goto Forum:
Current Time: Fri Apr 26 03:16:48 GMT 2024
Powered by FUDForum. Page generated in 0.03120 seconds
|