|
Re: AssociationClass directions [message #628404 is a reply to message #628374] |
Mon, 26 April 2010 14:00 |
|
Hi, Lisa,
As with simple Associations, the "directionality" is implied by which
ends of the association-class are navigable. Your code snippet sets
both ends navigable. Let one of them not be navigable. e.g., if
ownedEnd1 is not navigable, then the "direction" is from class1_ to class2_.
Also as with associations, an end of an AssociationClass can be owned by
one of the classifiers that it associates (e.g., class1_ or class2_),
rather than the association-class itself. Such an end is implicitly
navigable.
HTH,
Christian
On 19/04/10 12:53 PM, Lisa wrote:
> Hi everyone,
> I've creater an AssociationClass using:
>
> UMLFactory.eINSTANCE.createAssociationClass();
>
> than I created two owned members as follows:
>
> Property ownedEnd1 = associationClass.createOwnedEnd(null, class1_);
> ownedEnd1.setLower(end1LowerBound);
> ownedEnd1.setUpper(end1UpperBound);
> ownedEnd1.setAggregation(end1AggregationKind);
> ownedEnd1.setIsNavigable(true);
> Property ownedEnd2 = associationClass.createOwnedEnd(null, class2_);
> ownedEnd2.setLower(end2LowerBound);
> ownedEnd2.setUpper(end2UpperBound);
> ownedEnd2.setAggregation(end2AggregationKind);
> ownedEnd2.setIsNavigable(true);
>
> and both class1_ and class2_ are instance of org.eclipse.uml2.uml.Class
>
> my question is how do I set the direction of the association that will
> be created between class1_ and class2
>
> thanks,
> Lisa
|
|
|
Powered by
FUDForum. Page generated in 0.02619 seconds