A relationship between two classes.

In the Unified Modeling Language (UML), there are five different types of relationships: association, aggregation, composition, dependency, and inheritance.

Association is a semantically weak relationship (a semantic dependency) between otherwise unrelated objects. An association is a ‘using’ relationship between two or more objects in which the objects have their own lifetime and there is no owner.

As an example, imagine the relationship between a doctor and a patient. A doctor can be associated with multiple patients. At the same time, one patient can visit multiple doctors for treatment or consultation. Each of these objects has its own life cycle and there is no ‘owner’ or parent. The objects that are part of the association relationship can be created and destroyed independently.

In UML an association relationship can be represented as one-to-one, one-to-many, or many-to-many (also known as cardinality).

Leave a Comment