After getting introduced to Design Patterns we have so far examined the following patterns:
- Adapter Pattern
- Facade pattern
- Composite Pattern
- Bridge Pattern
- Singleton Pattern
- Observer Pattern
- Proxy Pattern
- Chain of Responsibility Pattern
- Flyweight Pattern
- Builder Pattern
- Factory Method Pattern
- Abstract Factory Design Pattern
- Prototype Design Pattern
- Memento Design Pattern
- Template Design Pattern
- State Design Pattern
- Strategy Design Pattern
- Command Design Pattern
- Interpreter Design Pattern
- Decorator Design Pattern
- Iterator Design Pattern
Now, we will now get to know the Visitor Design Pattern.
The Visitor Design Pattern provides you with a way to add new operations on the objects without changing the classes of the elements, especially when the operations change quite often. The intent of the Visitor Design Pattern is to 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.
Via a real life example, you will learn how and when the Visitor design pattern should be used and how to structure your code in order to implement it. You will see how it can lead to elegant solutions to code problems.
from Java Code Geeks http://academy.javacodegeeks.com/news/visitor-design-pattern/
No comments:
Post a Comment