Skip to content

📘 UML Class Diagram Relationships Tutorial

In UML Class Diagrams, relationships between classes are crucial for understanding how different components of a system interact with each other. Each type of relationship has associated verbs or phrases that help clarify the nature of the connection. This tutorial will guide you through the different types of relationships, their definitions, and common verbs used to describe them.

📑 Table of Contents

  1. 🔗 Association
  2. 🔄 Aggregation
  3. 🧩 Composition
  4. 🧬 Inheritance (Generalization)
  5. 🎯 Realization (Interface Implementation)
  6. 🛠️ Dependency
  7. 🔁 Bidirectional Association
  8. ➡️ Unidirectional Association

🔗 Association

Definition: A basic relationship where one class is connected to another. It represents a general connection between classes.

📜 Common Verbs

  • "uses"
  • "works with"
  • "communicates with"
  • "interacts with"

📝 Example

A Customer "uses" an Account.


🔄 Aggregation

Definition: A "whole-part" relationship where one class (the whole) contains or is composed of other classes (the parts), but the parts can exist independently of the whole.

📜 Common Verbs

  • "has a"
  • "contains"
  • "is composed of"
  • "consists of"

📝 Example

A Library "contains" Books.


🧩 Composition

Definition: A stronger form of aggregation where the contained parts (components) cannot exist independently of the whole. If the whole is destroyed, the parts are also destroyed.

📜 Common Verbs

  • "is composed of"
  • "owns"
  • "is made up of"

📝 Example

A Car "is composed of" an Engine.


🧬 Inheritance (Generalization)

Definition: Represents an "is-a" relationship where one class (the child) inherits the properties and methods of another class (the parent).

📜 Common Verbs

  • "is a type of"
  • "inherits from"
  • "is a subtype of"

📝 Example

A Dog "is a type of" Animal.


🎯 Realization (Interface Implementation)

Definition: Indicates that a class implements the operations defined by an interface.

📜 Common Verbs

  • "implements"
  • "realizes"
  • "conforms to"

📝 Example

A PaymentProcessor "implements" the PaymentInterface.


🛠️ Dependency

Definition: Represents a "uses" relationship where one class depends on another class for its functionality. This relationship is typically weaker and more transient than an association.

📜 Common Verbs

  • "depends on"
  • "uses"
  • "requires"
  • "needs"

📝 Example

An Order "depends on" a Customer for processing.


🔁 Bidirectional Association

Definition: A two-way association where both classes are aware of each other and can interact.

📜 Common Verbs

  • "interacts with"
  • "knows"
  • "refers to"

📝 Example

A Teacher "knows" a Student, and vice versa.


➡️ Unidirectional Association

Definition: A one-way association where only one class is aware of and interacts with another class.

📜 Common Verbs

  • "refers to"
  • "points to"

📝 Example

A Company "refers to" its Employees.


This tutorial provides a clear overview of the different types of relationships in UML Class Diagrams, along with the verbs used to describe each type of relationship. Understanding these relationships helps in designing and visualizing the interactions within a system more effectively.