Structural combination pattern ---

1 Basics

Definition: combining objects in a tree structure to represent "part - whole" hierarchy. Wherein: combined mode allows the client to maintain a consistent manner to the individual objects and composite objects.

: Usage scenario when handling a tree structure; client desired difference in combination with a single target object may be ignored.

Advantages: apparent complexity hierarchical object definition, it represents all or a portion of the object hierarchy; let the client ignores differences in level, facilitate control of the entire hierarchy; simplified client code; comply with the principle of opening and closing. Disadvantages: it would be more complicated when the limit type; the design becomes more abstract.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

Guess you like

Origin www.cnblogs.com/youngao/p/11351151.html