Examples

A useful and demonstrating list of examples

Preliminaries

Common classes

Visitor

Visit without entering

Stateful class

Add a state to your class

Composition

Towards a functional approach

State

A changing state

Comparator

Compare the elements

Strategy

Multimethod as strategy

Factory

Create the elements

Observer

Observe the elements

Queue

Producer and consumer

ToString

Another way of definition

Tree walker

Walk without falling