Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Navigability, ends owned by Association, how to relate ends and associated elements
Navigability, ends owned by Association, how to relate ends and associated elements [message #470384] Tue, 13 February 2007 11:38 Go to next message
Thomas Maier is currently offline Thomas MaierFriend
Messages: 117
Registered: July 2009
Senior Member
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 #470391 is a reply to message #470384] Tue, 13 February 2007 15:46 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
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 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
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 Go to previous messageGo to next message
Thomas Maier is currently offline Thomas MaierFriend
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 #471171 is a reply to message #470394] Wed, 28 February 2007 10:13 Go to previous message
Thomas Maier is currently offline Thomas MaierFriend
Messages: 117
Registered: July 2009
Senior Member
Kenn, thanks a lot, somehow I overlooked that method. 'twas hard work,
but now I finally got my code up to UML2 2.x. Thanks, Thomas.

Kenn Hussey wrote:
> Thomas,
>
> Assuming you are working with binary associations, the type (element) at
> member end 'i' corresponds to
> getMemberEnds().get(i).getOtherEnd().getType()...
>
> Kenn
>
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 Go to previous message
james bruck is currently offline james bruckFriend
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 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
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 Go to previous message
Thomas Maier is currently offline Thomas MaierFriend
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 #593940 is a reply to message #470394] Wed, 28 February 2007 10:13 Go to previous message
Thomas Maier is currently offline Thomas MaierFriend
Messages: 117
Registered: July 2009
Senior Member
Kenn, thanks a lot, somehow I overlooked that method. 'twas hard work,
but now I finally got my code up to UML2 2.x. Thanks, Thomas.

Kenn Hussey wrote:
> Thomas,
>
> Assuming you are working with binary associations, the type (element) at
> member end 'i' corresponds to
> getMemberEnds().get(i).getOtherEnd().getType()...
>
> Kenn
>
Previous Topic:Re: UML2 Profile Usage
Next Topic:Adding to DerivedEObjectEList gives UnsupportedOperationException, apparently new since EMF 2.3
Goto Forum:
  


Current Time: Fri Mar 29 07:45:38 GMT 2024

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

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

Back to the top