Operator Design Pattern Decorator
Objective Attach additional responsibilities to an object dynamically
Parameters Objects: COMPONENT;
Subtasks
1 - Instantiate Concrete Object: COMPONENT -> ConcreteCOMPONENT
2 - Create Interface Object: COMPONENT -> DECORATOR
3 - Instantiate Concrete Object: DECORATOR -> ConcreteDECORATOR
Consequences
You can attach dynamically ConcreteCOMPONENT functionality
to ConcreteDECORATOR objects
Product Text
ADV/ADO DECORATOR
Declarations
...
Attributes
ComponentType: ADO COMPONENT
Nested ADVs/ADOs
Compose ComponentType;
Inherit Component;
...
End DECORATOR
ADV/ADO ConcreteCOMPONENT
Declarations
...
Nested ADVs/ADOs
Inherit Component;
...
End ConcreteCOMPONENT
ADV/ADO ConcreteDECORATOR
Declarations
...
Effectual Actions
AttachComponent: ADO COMPONENT
Nested ADVs/ADOs
Inherit Decorator;
Dynamic Properties
...
Valuation
AttachComponent(ComponentType) ->
O ComponentType = ProvideInstance(COMPONENT);
...
End ConcreteDECORATOR
End Operator
Tex version