Maintainability:?
- By keeping the logic separate from the elements, the code is easier to
maintain and extend, since new behaviors are added in visitor classes rather
than modifying the core objects.
When to Use the Visitor Pattern:
maintain and extend, since new behaviors are added in visitor classes rather
than modifying the core objects.
When to Use the Visitor Pattern: