Class Diagram - Aggregation and Composition Notations

This section describes Aggregation and Composition Notations used in a UML Class Diagram. Aggregation and Composition Notations represent a special type of association called 'aggregation' between a pair of parent and child classes, where the child class is considered as a part of the parent class.

Aggregation and Composition Notations are graphical notations used in a UML Class Diagram to represent a special type of association called "aggregation" between a pair of parent and child classes, where the child class is considered as a part of the parent class.

An aggregation has two variations:

1. Shared Aggregation (also called as "Aggregation") - In a shared aggregation, instances of the child class can exist without any instances of the parent class. Usually, the child class is shared by two or more parent classes as aggregation pairs.

For example, the "Class" class and the "Student" class are associated as a shared aggregation, because students are considered as parts of a class, but students can exist without registering to any class.

An Aggregation (shared aggregation) Notation is drawn as an Association Notation with a small diamond shape added to the parent class end.

2. Composite Aggregation (also called as "Composition") - In a composite aggregation, instances of the child class exist only if they are associated with instances of the parent class.

For example, the "Order" class and the "Order Line" class are associated as a composite aggregation, because order lines are considered as parts of an order, and order lines can not exist without an order.

A Composition (composite aggregation) Notation is drawn as an Association Notation with a small solid diamond shape added to the parent class end.

The following picture shows examples of a Shared Aggregation Notation and a Composite Aggregation Notation used in a UML class diagram:

UML Notation Shapes - Aggregation End Composition
UML Notation Shapes - Aggregation End Composition

Table of Contents

 About This UML Tutorial Book

 Introduction of UML (Unified Model Language)

UML Class Diagram and Notations

 What Is a Class Diagram?

 Class Diagram - Class Notation

 Class Diagram - Association Notation

 Class Diagram - Association End Notation

 Class Diagram - Association End Navigability Notation

Class Diagram - Aggregation and Composition Notations

 Class Diagram - Generalization Notation

 Class Diagram - Realization Notation

 Class Diagram - Dependency Notation

 UML Activity Diagram and Notations

 UML Sequence Diagram and Notations

 UML State Machine Diagram and Notations

 UML Use Case Diagram and Notations

 LibreOffice Drawing Extension - UML Elements

 MS Visio 2010 - UML Drawing Tool

 References

 Full Version in PDF/EPUB