Class Diagram
Source: Dev.to
Overview
A class diagram is the backbone of object‑oriented modeling—it shows how different entities (people, things, and data) relate to each other and represents the static structure of a system.
It describes the attributes, operations, and constraints of classes and can be mapped directly to object‑oriented languages.
Purpose of a Class Diagram
- Analyze and design the static view of an application.
- Describe the responsibilities of a system.
- Provide a base for component and deployment diagrams.
- Support forward and reverse engineering.
Class Representation
A class is depicted as a rectangle divided into three horizontal sections:
- Name – the class name (e.g.,
Flight). - Attributes – the properties of the class.
- Operations – the methods of the class.

Types of Relationships
Association
An association links two classes that need to communicate.
- Bidirectional (default): both classes are aware of each other.
- Unidirectional: navigation is allowed only in one direction.

Multiplicity
Multiplicity specifies how many instances of a class participate in a relationship (e.g., 0..*, 2..4). It is shown as adornments on the association line.
Aggregation
A special form of association representing a “whole‑part” relationship where the part can exist independently of the whole.
Example: An Aircraft can exist without an Airline.
Composition
A stronger whole‑part relationship where the part’s lifecycle depends on the whole.
Example: A WeeklySchedule is composed within a Flight; when the Flight ends, the WeeklySchedule is destroyed.
Generalization
Generalization combines similar classes into a more general superclass, highlighting commonalities.
Example: Crew, Pilot, and Admin are all specializations of Person.
Dependency
A dependency indicates that one class (the client) uses or depends on another class (the supplier).
Example: FlightReservation depends on Payment.
Abstract Class
An abstract class is identified by rendering its name in italics.
In the diagram below, Person and Account are abstract classes.

Additional Resources
- For more on sequence diagrams, see: