1 The course explains
1.1 Type:
1.2 Definitions:
1.3 application scenarios:
1.4 Advantages:
1.5 Disadvantages:
1.6 Visitor pattern associated design patterns
1 The course explains
1.1 Type:
Behavioral
1.2 Definitions:
◆ package each acting on an element of a data structure (e.g., List / Set / Map etc.) operation
◆ can be made without changing the elements of the class definition of the role of these elements in operation
1.3 application scenarios:
◆ a data structure such as (List / Set / Map, etc.) contain many types of objects
◆ data structures and data manipulation separated
1.4 Advantages:
◆ very easy to add new operations, an increase of a new visitor
1.5 Disadvantages:
◆ add a new data structure difficult
◆ specific elements of change is too much trouble
1.6 Visitor pattern associated design patterns
◆ Visitor pattern and iterator pattern
Common: all data is processed in a certain structure,
The main element of the visitor pattern stored in the data structure is a specific process , mainly by-Iterator traversal stored in the data structure elements.