Inserting an Association
Classes can be linked with each other via associations. An association expresses how an instance of this classifier can be linked to an instance of the second classifier, and vice versa, how each instance of the second classifier is linked with an instance of this classifier.
Prerequisites
At least one relationship template for associations needs to exist in the model to be able to create an association.
This example assumes that both classes to be linked are already in the diagram. As an alternative, you can create a new class together with the association.
Context
The class has a defined relationship to another class. This association is depicted by a line between the actor and use case.
You can create an association between a class and a new or existing class in the diagram using the mouse. If the association is not directed, you can create the association starting from both sides.
Tip
There are predefined templates for a range of regularly used templates such as 1:many or Aggregation; in these templates, properties such as Upper and Lower Bound, Navigability or Kind of Aggregation are preallocated accordingly. You can save yourself the hassle of making changes at a later stage by selecting the suitable template.
How to proceed
-
Select the class in the diagram
The selected class is outlined with a blue frame and the carousel appears.
-
Move the mouse pointer over the connection type
(association).
-
To create an association to an existing class, drag the link to it with the mouse button pressed and release the mouse button.
The association is created and initially contains the properties preallocated in the
Association template. You can immediately change these properties using the
Properties tool window or the association's context menu.
-
If you want to create an association to a new class instead, drag the link with the mouse button pressed to the free target position and release the mouse button.
The Create Connection dialog appears.
-
Select the element type Class for the new diagram element.
A class and the association to the selected class are inserted in the diagram. The class is integrated into the model structure. A unique name is created and selected.
-
Enter the name of the class and then press the [Enter] key.
The class is renamed. An error message appears if the name entered is not unique.