Visitor Pattern – new operations without modifying the structure of objects
The Visitor Pattern allows adding new operations to a set of objects without modifying their classes. The logic is extracted into a separate "visitor," which knows how to act on each type of object. The pattern is ideal when the object structure is stable, but the operations on them change frequently.
Citește mai mult