Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Containment

Membership is usually shown by nesting. When it is clearer to draw a line, owner +-- member puts a circle-plus on the owner. Members in the next rank share one trunk.

diagram package "Containment"

package Types
class Shape
class Point
Types +-- Shape
Types +-- Point
Containment Types Shape Point

Syntax

owner +-- member
member --+ owner

Use it for members declared outside the owner’s block. A member drawn inside its owner needs no line, so +-- to it is an error.

Specification

UML 2.5.1, 12.2.4 (p. 248).

Used in

Package diagrams: containment.