Types of relationships in UML class diagram

  1. Dependencies
  2. Generalizations
  3. Associations

Dependencies

  • Indicates semantic relationship btw two classes

Generalizations

  • Connects a sub class to it’s super class (Inheritance basically)

  • Reverse is called specialization

Note

JAVA doesn’t support multiple inhertence


Association

  • A communication btw two classes

  • We can name the association

  • We can use dual association,

  • We can define navigatability,

  • Association can be objects themselves (association or link classes)

  • Self association is possible

  • Composition and Aggregation are sub types

Aggregation

  • Indicates a “part-whole” relationship
  • Denoted by a hallow diamond

Composition

  • Indicates strong ownership (stronger form of aggregation)
  • Life time of the part is intertwined on the lifetime of the whole
  • Denoted by a filled diamond


Summary



Sources