▪An Association classifies a set of tuples representing links between typed instances. An AssociationClass is both an Association and a Class.
▪An Association specifies that there can be “Links between instances whose types conform to or implement the associated types. A link is a tuple with one value for each memberEnd of the Association, where each value is an instance whose type conforms to or implements the type at the end.”.
The Association definition has references through its member Properties to other model elements, for example Class A and B.
Navigability
▪You might want to be able to navigate from an A object to a related B object so you create a property in Class A that allows you to do that.
▪Unidirectional Association: You might not want to be able to navigate from B to A in which case the property representing A-B to B would be owned by the association and set as non-navigable (there is a separate property from memberEnds which lists the navigable properties). When an association is non-navigable in one direction, it is essentially unidirectional – one class knows about the association to the other class, but the second class does not know about the association.
▪Bidirectional Association: A bidirectional association has both an owning side and an inverse side, whereas the unidirectional association has only an owning side.
The Property representing the connection from A-B to B is set to be owned by the association rather than class A if it is not to be navigable from class A, otherwise it is set to be owned by class A.
How to create an Association
To model an Association between two Model Elements, perform these steps:
1 Create an Association definition or an Association Class definition – either by creating the definition through the Explorer tree or drawing such a symbol on a diagram.
2 Draw an Association Node to Class as Property from the Association definition to an associated Classifier. Doing so creates a Property (or Port, which is a subtype of Property), which is a memberEnd of the Association.
You draw from the Association (or Association Class) to the class you want the property to reference.
You can set the type of ownership in the memberEnd property of the owning “works at” association.
3 Draw an Association Node to Class as Property from the Association definition to all other associated Classifiers.
When the relationship is drawn, the Association Node is made invisible.
In this example, drawing the association to the Company class specifies that you want to create a property in either the “works at” association or the Person class.
To specify that the association is navigable from the Class Company, and therefore that the class Company owns the property, you select the “employee” Property in the ownedAttribute property of the Class tab of the Company definition – drag-and-dropping it from the Choices list – it was created by drawing the Association Node to Class as Property relationship above.