previous | start | next

## The VISITOR Pattern

### Solution

1. Define a visitor interface type that has methods for visiting elements of each of the given types.
2. Each element class defines an accept method that invokes the matching element visitation method on the visitor parameter.
3. To implement an operation, define a class that implements the visitor interface type and supplies the operation s action for each element type.

previous | start | next