diff options
author | Max-001 <80035972+Max-001@users.noreply.github.com> | 2024-09-19 17:35:06 +0200 |
---|---|---|
committer | Max-001 <80035972+Max-001@users.noreply.github.com> | 2024-09-19 17:35:06 +0200 |
commit | 36409a542b1b9ccd42d71dc55ca6414276f93dcf (patch) | |
tree | 4a9bf35e574f1964202d8a058b4195c126ef3d9d /img/decorator-design-pattern.puml | |
parent | 33c573aa26198822e7873edcd567553eb6aebd79 (diff) | |
parent | 41ac21680ef13e2db543ff56728ecffe504d6850 (diff) |
Merge remote-tracking branch 'origin/master' into max/time
Diffstat (limited to 'img/decorator-design-pattern.puml')
-rw-r--r-- | img/decorator-design-pattern.puml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/img/decorator-design-pattern.puml b/img/decorator-design-pattern.puml new file mode 100644 index 0000000..2bc406b --- /dev/null +++ b/img/decorator-design-pattern.puml @@ -0,0 +1,62 @@ +@startuml +!include theme.ipuml +skinparam style strictuml +skinparam Linetype ortho + +class Client +class Component <<interface>> { + + execute() + -- +} +class ConcComponent as "Concrete\nComponent" { + ... + -- + + execute() +} +class BaseDecorator as "Base Decorator" { + - wrappee: Component + + BaseDecorator(c: Component) + + execute() +} +class ConcDecorator as "Concrete\nDecorators" { + ... + -- + + execute() + + extra() +} + +hide Client members +hide circle + +Client --> Component +Component <|.. ConcComponent +Component <|.. BaseDecorator +Component <--o BaseDecorator +BaseDecorator <|-- ConcDecorator + +ConcComponent -right[hidden] BaseDecorator + +note right of Client + a = <b>new</b> ConcComponent() + b = <b>new</b> ConcDecorator1(a) + c = <b>new</b> ConcDecorator1(b) + c.execute() + // Decorator -> Decorator -> Component +end note + +note right of BaseDecorator::BaseDecorator + wrappee = c +end note + +note right of BaseDecorator::execute + wrappee.execute() +end note + +note right of ConcDecorator::execute + super::execute() + extra() +end note + +@enduml + +" referenced from <https://github.com/algamza/algamza.github.io> |