definition
Name: Visitor Structure: Intent: Represents an operation of each element that acts in a target structure. It allows you to define new operations for these elements without changing the class of each element. Applicability: An object structure contains many types of objects, which have different interfaces, and you want to implement some operations that depend on their specific classes. There is a need for many different and discontinued operations in an object structure, and you want to avoid these objects of these objects to "pollution". VI S i T O r makes you focus on a class in a class. When the object structure is shared by many applications, the VI S i T O R mode allows each application only contains the required operations. Define the class of the object structure rarely change, but often needs to define new operations on this structure. Changing the object structure The structure needs to redefine the interface to all visitors, which may require a lot. If the object structure class changes, it is possible to define these operations in these classes. effect:
Classic Case
1,
Best Practices
1,
Related mode
1,
Reference article
1,