aboutsummaryrefslogtreecommitdiff
path: root/img
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-09-18 20:51:55 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-09-18 20:51:55 +0200
commit7dc00a616e186bb8b02902e06b7cb38164acbbbd (patch)
tree081bae74afdc0ffe0e5696b20f90062f3274d680 /img
parentc69c8815df1c0e1e6ef155a9cfc4747132e0e1c6 (diff)
merge #15
Diffstat (limited to 'img')
-rw-r--r--img/decorator-design-pattern.puml62
-rw-r--r--img/theme.ipuml9
2 files changed, 69 insertions, 2 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>
diff --git a/img/theme.ipuml b/img/theme.ipuml
index 88d183a..4e3613e 100644
--- a/img/theme.ipuml
+++ b/img/theme.ipuml
@@ -1,5 +1,10 @@
!theme plain
-skinparam DefaultFontSize 14
+skinparam ClassAttributeIconSize 0
+skinparam ClassFontStyle bold
skinparam DefaultFontName Inter
+skinparam DefaultFontSize 14
+skinparam MaxMessageSize 200
+skinparam Nodesep 25
+skinparam Padding 2
+skinparam Ranksep 50
skinparam RoundCorner 0
-skinparam maxMessageSize 200