You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/08/23 12:22:41 UTC

[groovy] branch master updated: doco: inline UML for Chain of Responsibility pattern

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new b7ecf87  doco: inline UML for Chain of Responsibility pattern
b7ecf87 is described below

commit b7ecf877f3bb2a8c4a83ec1b52c7a186ec0a1ab9
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Aug 23 22:22:32 2020 +1000

    doco: inline UML for Chain of Responsibility pattern
---
 .../assets/img/ChainOfResponsibilityClasses.gif    | Bin 5779 -> 0 bytes
 ...ent_design-pattern-chain-of-responsibility.adoc |  26 ++++++++++++++++++++-
 .../doc/fragment_design-pattern-composite.adoc     |   5 ++--
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/src/spec/doc/assets/img/ChainOfResponsibilityClasses.gif b/src/spec/doc/assets/img/ChainOfResponsibilityClasses.gif
deleted file mode 100644
index dc4bae9..0000000
Binary files a/src/spec/doc/assets/img/ChainOfResponsibilityClasses.gif and /dev/null differ
diff --git a/src/spec/doc/fragment_design-pattern-chain-of-responsibility.adoc b/src/spec/doc/fragment_design-pattern-chain-of-responsibility.adoc
index 977dee1..8b6ed94 100644
--- a/src/spec/doc/fragment_design-pattern-chain-of-responsibility.adoc
+++ b/src/spec/doc/fragment_design-pattern-chain-of-responsibility.adoc
@@ -36,7 +36,31 @@ The output will be a list of files (with slightly different format depending on
 
 Here is a UML representation:
 
-image::assets/img/ChainOfResponsibilityClasses.gif[]
+[plantuml, ChainOfResponsibilityClasses, png]
+....
+skinparam nodesep 100
+hide <<HIDDEN>>
+class UnixLister {
+    nextInLine : Object
+    +listFiles(dir)
+}
+object dummy1<<HIDDEN>>
+class WindowsLister {
+    nextInLine : Object
+    +listFiles(dir)
+}
+object dummy2<<HIDDEN>>
+hide DefaultLister fields
+class DefaultLister {
+    +listFiles(dir)
+}
+object script
+script ..r..> "<<use>>" UnixLister
+UnixLister --> "forwardIfRequired" WindowsLister
+UnixLister <-[hidden]- dummy1
+WindowsLister <-[hidden]- dummy2
+WindowsLister --> "forwardIfRequired" DefaultLister
+....
 
 Variations to this pattern:
 
diff --git a/src/spec/doc/fragment_design-pattern-composite.adoc b/src/spec/doc/fragment_design-pattern-composite.adoc
index ca6e259..8cccfc7 100644
--- a/src/spec/doc/fragment_design-pattern-composite.adoc
+++ b/src/spec/doc/fragment_design-pattern-composite.adoc
@@ -30,6 +30,7 @@ Consider this usage of the composite pattern where we want to call `toString()`
 [plantuml, CompositeClasses, png]
 ....
 skinparam linetype ortho
+skinparam nodesep 100
 class Component {
     +toString()
 }
@@ -41,9 +42,9 @@ class Composite {
 }
 object componentClient
 hide fields
-Composite "1" *-- "*" Component : children
-componentClient ..r..> "uses" Component
+componentClient ..r..> "<<use>>" Component
 Component <|-- Leaf
+Composite "1" *-- "*" Component : children
 Component <|-- Composite
 ....