The Visitor Design Pattern is a behavioral pattern.
The visitor design pattern gives you the ability to add new operations to existing object without modifying the existing objects.
- When you have an already working codebase, currently running on production.
- When you want to add a function but it deviates from the primary goal.
- From breaking the already working codebase because of a potential bug in your changes.
- From making your code fragile and very time expensive to modify.