Class Diagram



Definition

A class diagram is a design diagram work product that primarily documents a cohesive collection of collaborating classes and types (interfaces) and the definitional and referential relationships between them.

Objectives

The typical objectives of a class diagram is to:

Benefits

The typical benefits of a class diagram are to:

Contents

The typical contents of a class diagram are:

Stakeholders

The typical stakeholders of a class diagram are:

Phases

Preconditions

Class diagrams can typially be started if the following preconditions hold:

Inputs

The typical inputs to a class diagram include:

Guidelines

Conventions

Class diagrams are typically constrained by the following conventions:

Examples

The following class diagram documents the software classes of a digital thermostat application. It uses the OML notation, a valid variant of the UML notation. Single line arrows represent relational relationships, and double line arrows represent inheritance relationships. The shield with the two parallel lines represents a concurrent class that is thread-safe.

Digital Thermostat Class Diagram
Example Digital Thermostat Class Diagram

Compare this diagram with the corresponding context diagram to see how the direction of referential (i.e., dependency and control flow) reverses at the software hardware boundary. Also compair this diagram with the corresponding domain object diagram to see how this diagram shows more classes and more detailed information about these classes (e.g., operations and attributes rather than responsibilities).