From dfa0fce642d68a0c17f87e53100f7a0590576a04 Mon Sep 17 00:00:00 2001
From: Daniel Hornung <d.hornung@indiscale.com>
Date: Thu, 3 Jun 2021 09:48:01 +0200
Subject: [PATCH] DOC: Plantuml diagrams

---
 src/doc/conf.py                   |  1 +
 src/doc/development/structure.rst | 45 +++++++++++++++++++++++++++++--
 src/test/docker/Dockerfile        |  3 ++-
 3 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/src/doc/conf.py b/src/doc/conf.py
index fee036d0..119f966e 100644
--- a/src/doc/conf.py
+++ b/src/doc/conf.py
@@ -47,6 +47,7 @@ extensions = [
     "recommonmark",            # For markdown files.
     "sphinx.ext.autosectionlabel",  # Allow reference sections using its title
     "sphinx_rtd_theme",
+    "sphinxcontrib.plantuml",  # PlantUML diagrams
 ]
 
 # Add any paths that contain templates here, relative to this directory.
diff --git a/src/doc/development/structure.rst b/src/doc/development/structure.rst
index 03950db9..41fd3324 100644
--- a/src/doc/development/structure.rst
+++ b/src/doc/development/structure.rst
@@ -30,8 +30,12 @@ Transactions are explained in detail in the :ref:`Transactions and Schedules<tra
 .. uml::
 
   @startuml
-  abstract AbstractCaosDBServerResource
-  class RetrieveEntityResource
+  abstract AbstractCaosDBServerResource {
+    {abstract} httpGetInChildClass()
+    {abstract} httpPostInChildClass()
+    {abstract} ...InChildClass()
+  }
+  abstract RetrieveEntityResource
   class EntityResource
   AbstractCaosDBServerResource <|-- RetrieveEntityResource
   RetrieveEntityResource <|-- EntityResource
@@ -60,6 +64,43 @@ main packages which handle the backend:
     method.  These classes may use specific backend implementations (like for example the MySQL
     implementations) to interact with the backend database.
 
+
+.. uml::
+
+  @startuml
+  together {
+    abstract BackendTransaction {
+      HashMap impl // stores all implementations
+      abstract execute()
+    }
+    note left of BackendTransaction::impl
+      Stores the
+      implementation
+      for each
+      interface."
+    end note
+    package ...backend.interfaces {
+      interface GetIDByNameImpl {
+        abstract execute(String name, String role, String limit)
+      }
+    }
+  }
+  together {
+    package ...backend.transaction {
+      class GetIDByName extends BackendTransaction {
+        execute()
+      }
+    }
+    package ...backend.implementation.MySQL {
+      class MySQLGetIDByName implements GetIDByNameImpl {
+        execute(String name, String role, String limit)
+      }
+    }
+  }
+
+  GetIDByName::execute --r-> MySQLGetIDByName
+  @enduml
+
 .. _transactions:
 
 Transactions and Schedules
diff --git a/src/test/docker/Dockerfile b/src/test/docker/Dockerfile
index 08a2a088..f3c8b98f 100644
--- a/src/test/docker/Dockerfile
+++ b/src/test/docker/Dockerfile
@@ -2,10 +2,11 @@ FROM debian:buster
 RUN apt-get update && \
   apt-get install -y \
     git make mariadb-server maven openjdk-11-jdk-headless \
+    plantuml \
     python3-pip screen libpam0g-dev unzip curl shunit2 \
     python3-sphinx \
   && \
-  pip3 install javasphinx recommonmark sphinx-rtd-theme
+  pip3 install javasphinx recommonmark sphinx-rtd-theme sphinxcontrib-plantuml
 
 # Alternative, if javasphinx fails because python3-sphinx is too recent:
 # (`_l` not found):
-- 
GitLab