From af544068c1ca1ff48650d0550df9120e5fd62382 Mon Sep 17 00:00:00 2001 From: TGITS Date: Sat, 17 Feb 2024 13:14:56 +0100 Subject: [PATCH] feat(wip_for_article) Finalisation of the site for the article --- docs/configuration_example.md | 54 +++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/docs/configuration_example.md b/docs/configuration_example.md index eea301d..98fddb9 100644 --- a/docs/configuration_example.md +++ b/docs/configuration_example.md @@ -106,17 +106,47 @@ frequencies.entrySet().iterator().forEachRemaining(System.out::println); ## Diagrams with Mermaid examples -Hereafter an example with a sequence diagram but any diagram supporrted by [mermaid](https://mermaid.js.org/) is possible. +Hereafter an example with a class and a sequence diagram (inspired by the [Visitor Pattern](https://refactoring.guru/design-patterns/visitor)) but any diagram supported by [mermaid](https://mermaid.js.org/) is possible. -``` mermaid +```mermaid +classDiagram + class Visitor{ + +visit(ConcreteElementA element) + +visit(ConcreteElementB element) + } + + <> Visitor + + class ConcreteVisitorA { + +visit(ConcreteElementA element) + +visit(ConcreteElementB element) + } + + Visitor <|.. ConcreteVisitorA + + class Element{ + +accept(Visitor visitor) + } + + <> Element + + class ConcreteElementA{ + +accept(Visitor visitor) + } + + class ConcreteElementB{ + +accept(Visitor visitor) + } + + Element <.. ConcreteElementA + Element <.. ConcreteElementB + +``` + +```mermaid sequenceDiagram - autonumber - Alice->>John: Hello John, how are you? - loop Healthcheck - John->>John: Fight against hypochondria - end - Note right of John: Rational thoughts! - John-->>Alice: Great! - John->>Bob: How about you? - Bob-->>John: Jolly good! -``` \ No newline at end of file + client->>concreteElementA: accept(visitor) + concreteElementA->>visitor: visit(concreteElementA) + client->>concreteElementB: accept(visitor) + concreteElementB->>visitor: visit(concreteElementA) +```