Lecture overview -- Keyboard shortcut: 'u'  Previous page: Patterns and Techniques [Section] -- Keyboard shortcut: 'p'  Next page: A Composite Example: Music Elements -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Abstract classes, Interfaces, and Patterns - slide 20 : 37

The Composite design pattern

A Composite design pattern composes objects into tree structures.

Clients operate uniformly on leaves and composite nodes

The tree structure may be non-mutable and built via constructors

Alternatively, the tree structure may be mutable, and built via Add and Remove operations