Visitor

Represent an operation to be performed on the elements of an object structure. Visitor
lets you define a new operation without changing the classes of the elements
on which it operates.
Applicability
- Need to perform operations on the objects in a structure, and these objects have differing interfaces
- Need to perform distrinct and unrelated operations on objects, and you want to avoid "polluting" their
classes with these operations
- Need to define new operations over a rarely-changing structure
Consequences
- Makes adding new operations easy
- Gathers related operations and separates unrelated ones
- Adding new ConcreteElements is hard
- Works across objects of differing types
- Can accumulate state
- May force a break in encapsulation