Benefits:
• It simplifies the addition of new operations.
• It gathers related operations while separating unrelated ones.
Applicable Scenarios:
• An object structure contains many objects with differing interfaces and there is a need to perform operations on these objects in a way that depends on their concrete classes.
• Many distinct and unrelated operations need to be performed on objects in a structure and there is a need to avoid cluttering the classes with these operations.
• The classes defining the object structure rarely change but you frequently need to define new operations that perform over the structure.

2576

被折叠的 条评论
为什么被折叠?



