Home » Modeling » UML2 » org.eclipse.uml2.uml.Type::createAssociation
| org.eclipse.uml2.uml.Type::createAssociation [message #760371] |
Fri, 02 December 2011 03:19  |
|
Hello,
i'm confused a little bit with the strange behaviour, which method
createAssociation has. It's signature is:
Association createAssociation(boolean end1IsNavigable,
AggregationKind end1Aggregation,
java.lang.String end1Name,
int end1Lower,
int end1Upper,
Type end1Type,
boolean end2IsNavigable,
AggregationKind end2Aggregation,
java.lang.String end2Name,
int end2Lower,
int end2Upper)
I want to explain, what i found strange, using example from this tutorial:
http://wiki.eclipse.org/MDT/UML2/Getting_Started_with_UML2
There, classes Supplier and PurchaseOrder are in an association, which
is created with the following call:
createAssociation(supplierClass, true,
AggregationKind.COMPOSITE_LITERAL, "orders", 0,
LiteralUnlimitedNatural.UNLIMITED, purchaseOrderClass, false,
AggregationKind.NONE_LITERAL, "", 1, 1);
If we map actual arguments to formal params of the createAssociation
method, we get
end1 = supplierClass, end1Name = "orders"
end2 = purchaseOrderClass, end2Name = ""
supplierClass.createAssociation(..., end1Name, ..., purchaseOrderClass,
....);
As I understand, it should create an association, where one of the ends,
end1, which represented with supplierClass, has name(role) "orders". But
if we look at the class diagram, we see, that "orders" is assigned to
the another end of the association, end2, that is to purchaseOrderClass.
So, everything get's "inverted" when we think in terms of
createAssociation method.
Now, the question is, is that really so, is my observation right or wrong?
Thanks in advance
|
|
|
Goto Forum:
Current Time: Fri May 24 05:46:24 EDT 2013
Powered by FUDForum. Page generated in 0.01665 seconds
|