diff options
| author | Jaro <jarorutjes07@gmail.com> | 2024-10-01 09:54:41 +0200 |
|---|---|---|
| committer | Jaro <jarorutjes07@gmail.com> | 2024-10-01 09:54:41 +0200 |
| commit | 14f0f8c62a2914bdbbb8d9d90f65ba4dbdffd674 (patch) | |
| tree | ef9ec6a77e52b8b6eae386f39ce71f9582669832 /img/decorator-design-pattern.puml | |
| parent | c191f5e193e3ff5ce886b0fbe1efe8d7ddd04183 (diff) | |
| parent | f0cacf550e7b621d58ae9e92b5a1ee66b5e60be0 (diff) | |
Merge branch 'master' of github.com:lonkaars/crepe-docs into jaro/research
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> |