Operator Design Pattern Composite
Objective Compose objects into tree structures to
represent part-whole hierarchies
Parameters Objects: COMPONENT;
Subtasks
1 - Create a Tree Structure.
1.1 - Instantiate Concrete Object: COMPONENT -> COMPOSITE
1.2 - Instantiate Concrete Object: COMPONENT -> LEAFs
1.3 - Compose Objects: LEAFs, COMPOSITE -> COMPOSITE
1.4 - If Subtree is needed:
1.4.1 - Recursively Create SubTrees (Step 1)
1.4.2 - Compose Objects: SubCOMPOSITE, COMPOSITE -> COMPOSITE
Consequences
A tree structure composed of LEAF objects and COMPOSITE objects is
created, where the last ones represent the internal nodes of the tree
Product Text
ADV/ADO COMPOSITE
Declarations
...
Attributes
ComponentType: ADO COMPONENT;
Nested ADVs/ADOs
Set CompSet of ComponentType;
Inherit Component;
...
End COMPOSITE
ADV/ADO LEAF
Declarations
...
Nested ADVs/ADOs
Inherit Component;
...
End LEAF
End Operator
Tex version