Visitor

xiaoxiao2021-03-06  54

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.

转载请注明原文地址:https://www.9cbs.com/read-116245.html

New Post(0)