An association is a relationship between two classes. It is represented by a solid line. Though associations are bi-directional by default, they can also be unidirectional, where one class knows about the other class and the relationship but the other class does not. Sometimes an association links a class to itself. This association is called a recursive (reflexive) association. One example of this association is an employee who is managed by a manager who is also himself an employee.
To draw a recursive (reflexive) association
- Select Association.
- Click a class (Employee in this example) and hover over the class until you see a rectangle shape. Click the class again to create a recursive association.
Association Properties
You can specify association properties in the association Specification window. The description of each property appears in the same window. The description area of the Specification window presents the descriptions.
To show the direction arrow near the association name
- Open the association Symbol properties dialog and set the Show Direction Arrow property to true.
The default Direction Arrow direction is displayed according the path creation direction.
To change the Direction Arrow direction
- Right-click the association.
- From the shortcut menu, select Reverse Direction Arrow.
The Direction Arrow is a graphical representation most often used in top level domain class diagrams. It helps to read a diagram and explains diagram semantics, and has no meaning in a model.
Usually, you would use the Direction Arrow on a diagram where navigability is not yet defined. Direction Arrows are usually displayed for named associations. When you create more detailed diagrams with specified navigability, direction arrows and association names are not usually displayed in these types of diagrams.
As shown in the following figure, User and Account Classes are connected with the Association. A navigation arrow can be displayed to either side depending on the Association name. If the association name is belongs to, the Direction Arrow should point from the Account to the User. If Association name is has, the Direction Arrow should point from the User to the Account.
Examples of Direction Arrows
In the Class diagram, you can add Attributes to an Association using an Association Class. The Association Class is a simple Class with a dashed line connected to the Association.
Adding Association between Read-Only Classifiers
Adding a new Association always creates two roles or properties at both ends. They are owned by the attached Classifier by default. However, when one or both ends of the Association are not editable (for example, locked in a server project or stored in a read-only profile or used project), the properties will be owned by the Association itself. In this case, a warning appears informing you about any unexpected issue in a model creation.