In this post we will talk about representing different kinds of association in Unified Modelling Language (UML). The term association is used to refer a specific types of logical connections found on class. Association is considered as relationship on instance level. Please refer this post for inheritance/generalization/realization.
Types of associations.
In general, there are five kinds of associations.
- Unidirectional Association.
- Bidirectional Association.
- Asymmetric Reflexive Associations.
- Symmetric Reflexive Associations.
In bidirectional association, two objects are related and both objects know about the relation.
In the above example steering is part of car. At the same time steering has it’s own existence.
Composition is special type of association. In this kind of association the whole virtually own the part. The part doesn’t exist without the whole.
In the above example menu is part of window. Menu exist only if windows exist. Once the window is closed the menu also get destructed.
Asymmetric Reflexive Associations.
Reflexive association is an association from an object to itself. In asymmetric association, ends of the association are semantically different from each other. In asymmetric reflexive association the roles at either end are different.
Symmetric Reflexive Associations.
Information placed at each end of an association indicating how many instances of one class can be related to instances of the other class
|1..2||one or two|
|1..*||minimum one; no maximum|
|1..4||minimum one; maximum four|
|0..*||zero or many|