UML- Association

Association is the semantic relationship between classes that shows how one instance is connected or merged with others in a system. The objects are combined either logically or physically. Since it connects the object of one class to the object of another class, it is categorized as a structural relationship. Following are the constraints applied to the association relationship are enlisted below:

  1. {implicit}: As the name suggests, the implicit constraints define that the relationship is not visible, but it is based on a concept.
  2. {ordered}: It describes that the set of entities is in a particular way at one end in an association.
  3. {changeable}: The changeable constraint ensures that the connections between several objects within a system are added, improved, and detached, as and when required.
  4. {addOnly}: It specifies that any new connection can be added from an object located at the other end in an association.
  5. {frozen}: The frozen constraint specifies that whenever a link is added between objects, it cannot be altered by the time it is activated over the connection or given link.

Reflexive Association

In the reflexive associations, the links are between the objects of the same classes. In other words, it can be said that the reflexive association consists of the same class at both ends. An object can also be termed as an instance.

Let's have a look at its example of a class vegetable. The vegetable class has two objects, i.e., onion and eggplant. According to the reflexive association's definition, the link between the onion and eggplant exist, as they belong to the same class, i.e., vegetable.

UML Association

Directed Association

The directed association is concerned with the direction of flow inside association classes. The flow of association can be shown by employing a directed association. The directed association between two classes is represented by a line with an arrowhead, which indicates the navigation direction. The flow of association from one class to another is always in one direction.

It can be said that there is an association between a person and the company. The person works for the company. Here the person works for the company, and not the company works for a person.

UML Association
Next TopicUML Dependency




Latest Courses