Skip to content

Commit 3643f58

Browse files
authored
Merge pull request #390 from kirchsth/feature/376_386_Layout
#376 (and #386): Lay_...() has correct orientation in combination with LAYOUT_LANDSCAPE() (and theme documentation is updated)
2 parents e6faecf + 0a5d36f commit 3643f58

7 files changed

+261
-10
lines changed

C4.puml

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
' !ENABLE_ALL_PLANT_ELEMENTS = 1
1010
' or with additional command line argument -DENABLE_ALL_PLANT_ELEMENTS=1
1111

12+
' C4-PlantUML v2.12 fixed a missing rotation bug in Lay_* calls in combination with LAYOUT_LANDSCAPE() call
13+
' (details see https://github.com/plantuml-stdlib/C4-PlantUML/issues/376)
14+
' If older diagrams should remain unchanged the bugfix can be deactivated with following statement
15+
' !NO_LAY_ROTATE = 1
16+
' or with follwing additional command line argument
17+
' -DNO_LAY_ROTATE=1
18+
' like
19+
' java -jar plantuml.jar -DNO_LAY_ROTATE=1 ...
20+
!global NO_LAY_ROTATE ?= 0
21+
1222
'Version
1323
' ##################################
1424
!function C4Version()
@@ -1749,32 +1759,64 @@ $getRel($right("<<-","->>"), $from, $to, $label, $techn, $descr, $sprite, $tags,
17491759
!return '-[hidden]' + %substr('------------', 0, %intval($distance) + 1)
17501760
!endfunction
17511761

1762+
!function $l_down($start,$end)
1763+
!if (NO_LAY_ROTATE == 0)
1764+
!return $down($start,$end)
1765+
!else
1766+
!return $start+"DOWN"+$end
1767+
!endif
1768+
!endfunction
1769+
1770+
!function $l_up($start,$end)
1771+
!if (NO_LAY_ROTATE == 0)
1772+
!return $up($start,$end)
1773+
!else
1774+
!return $start+"UP"+$end
1775+
!endif
1776+
!endfunction
1777+
1778+
!function $l_left($start,$end)
1779+
!if (NO_LAY_ROTATE == 0)
1780+
!return $left($start,$end)
1781+
!else
1782+
!return $start+"LEFT"+$end
1783+
!endif
1784+
!endfunction
1785+
1786+
!function $l_right($start,$end)
1787+
!if (NO_LAY_ROTATE == 0)
1788+
!return $right($start,$end)
1789+
!else
1790+
!return $start+"RIGHT"+$end
1791+
!endif
1792+
!endfunction
1793+
17521794
!unquoted procedure Lay_D($from, $to)
1753-
$from -[hidden]D- $to
1795+
$from $l_down("-[hidden]","-") $to
17541796
!endprocedure
17551797
!unquoted procedure Lay_Down($from, $to)
1756-
$from -[hidden]D- $to
1798+
$from $l_down("-[hidden]","-") $to
17571799
!endprocedure
17581800

17591801
!unquoted procedure Lay_U($from, $to)
1760-
$from -[hidden]U- $to
1802+
$from $l_up("-[hidden]","-") $to
17611803
!endprocedure
17621804
!unquoted procedure Lay_Up($from, $to)
1763-
$from -[hidden]U- $to
1805+
$from $l_up("-[hidden]","-") $to
17641806
!endprocedure
17651807

17661808
!unquoted procedure Lay_R($from, $to)
1767-
$from -[hidden]R- $to
1809+
$from $l_right("-[hidden]","-") $to
17681810
!endprocedure
17691811
!unquoted procedure Lay_Right($from, $to)
1770-
$from -[hidden]R- $to
1812+
$from $l_right("-[hidden]","-") $to
17711813
!endprocedure
17721814

17731815
!unquoted procedure Lay_L($from, $to)
1774-
$from -[hidden]L- $to
1816+
$from $l_left("-[hidden]","-") $to
17751817
!endprocedure
17761818
!unquoted procedure Lay_Left($from, $to)
1777-
$from -[hidden]L- $to
1819+
$from $l_left("-[hidden]","-") $to
17781820
!endprocedure
17791821

17801822
' PlantUML bug: lines which does "not match" with the orientation/direction of the diagram

README.md

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ C4-PlantUML includes macros, stereotypes, and other goodies (like VSCode Snippet
3030
- [Including the C4-PlantUML library](#including-the-c4-plantuml-library)
3131
- [Now let's create a C4 Container diagram](#now-lets-create-a-c4-container-diagram)
3232
- [Supported Diagram Types](#supported-diagram-types)
33-
- [System Context & System Landscape diagrams](#system-context--system-landscape-diagrams)
33+
- [System Context \& System Landscape diagrams](#system-context--system-landscape-diagrams)
3434
- [Container diagram](#container-diagram)
3535
- [Component diagram](#component-diagram)
3636
- [Dynamic diagram](#dynamic-diagram)
@@ -39,11 +39,13 @@ C4-PlantUML includes macros, stereotypes, and other goodies (like VSCode Snippet
3939
- [Samples](#samples)
4040
- [Relationship Types](#relationship-types)
4141
- [Layout (arrange) elements (without relationships)](#layout-arrange-elements-without-relationships)
42+
- [Compatibility mode `NO_LAY_ROTATE=1`](#compatibility-mode-no_lay_rotate1)
4243
- [Global Layout Options](#global-layout-options)
4344
- [Sprites and other images](#sprites-and-other-images)
4445
- [Custom tags/stereotypes support and skinparam updates](#custom-tagsstereotypes-support-and-skinparam-updates)
4546
- [Element specific tag definitions](#element-specific-tag-definitions)
4647
- [Boundary specific tag definitions](#boundary-specific-tag-definitions)
48+
- [Define a new legend title](#define-a-new-legend-title)
4749
- [Comments](#comments)
4850
- [Sample with different tag combinations](#sample-with-different-tag-combinations)
4951
- [Sample with tag dependent sprites and custom legend text](#sample-with-tag-dependent-sprites-and-custom-legend-text)
@@ -59,13 +61,20 @@ C4-PlantUML includes macros, stereotypes, and other goodies (like VSCode Snippet
5961
- [Advanced Samples](#advanced-samples)
6062
- [techtribes.js](#techtribesjs)
6163
- [Message Bus and Microservices](#message-bus-and-microservices)
64+
- [(C4 styled) Sequence diagram sample](#c4-styled-sequence-diagram-sample)
6265
- [Background](#background)
6366
- [License](#license)
6467
- [📄 Layout Options](LayoutOptions.md#layout-options)
6568
- [📄 Themes (different styles and languages)](Themes.md#themes)
6669
- samples
6770
- [📄 C4 Model Diagrams](samples/C4CoreDiagrams.md#c4-model-diagrams)
6871

72+
> [!IMPORTANT]
73+
> **PlantUML v2.12.0:** Layout could be changed based on bugfix.
74+
If `LAYOUT_LANDSCAPE()` is combined with `Lay_*()` calls then the elements are correct positioned based on the new implementation.
75+
The old implementation swapped up<->left and down<->right (details see [issue 376](https://github.com/plantuml-stdlib/C4-PlantUML/issues/376)).
76+
The old behavior can be re-activated with `!NO_LAY_ROTATE=1`. Details see [Compatibility mode `NO_LAY_ROTATE=1`](#compatibility-mode-no_lay_rotate1).
77+
6978
## Getting Started
7079

7180
### Including the C4-PlantUML library
@@ -464,6 +473,66 @@ Lay_Distance(LEGEND(), db, 1)
464473

465474
![db below legend, 1 unit distance](https://www.plantuml.com/plantuml/png/hL5DZzem4BtdLtXH3o0jH5NRIwLAYu3THUA30bkEqH0FuCgnKyy4r7_VCIIxKQjAFVGKvptFUtvl7eWXS5NOvCwut5OQrOcvfCzf6k0oE1e-LVkACEJUCJeUvBv8ImikplI9jJNxTFInluhGotoM5a2CGQ1i91DW78P16VMJEuq7-LNZoRVfQBdO_8CHLoNeyE7Dq0ZRFyYDFfN1C5BZf_4SENfrULmkjiFTPBESJ_whqHM32v8liF-fQUqjLGhkM5ceG_z9VuSp_8qhw8VD2CCPVnjlfqdZswdkT2L7xxeHkbUTKKNi2mmTEQ_GbnOLdu2LGzIg35vNEPEGxswPldIkKfrUyhggBfKWmvlLC6hKKU9nUq9Lo1Lb76CuG5vBi-1vRNlZG3pKHLfk6pLARIieZGWFLzEe7sk9tsTmsY8fi5R9bkGYaRB-QFAsNBpTrXhlktelqsDWs0DXL9gRF7Zo1rQRhxEhjBUQcXhkbGyQWn8xUVRPcnpbU_2X03RUjSrQMn7FP8ssxllMrGiX2HxXAn1ZjT5iVKjwVU0QGLEwYyAHJZRFortsE5iEjzF5KpQRF4qMusulcS7FR6o8mUNORT2RnFjUye1Eo_P_0G00 "db below legend, 1 unit distance")
466475

476+
### Compatibility mode `NO_LAY_ROTATE=1`
477+
478+
Based on the bugfix of [issue 376](https://github.com/plantuml-stdlib/C4-PlantUML/issues/376)
479+
the layout of old diagrams could be changed if they contain a combination of
480+
`LAYOUT_LANDSCAPE()` and `Lay_*()` commands like below.
481+
482+
```plantuml
483+
@startuml
484+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
485+
LAYOUT_LANDSCAPE()
486+
487+
Person(a, "A")
488+
System(sUp, "B up\nbefore bugfix left")
489+
System(sRight, "C right\nbefore bugfix down")
490+
System(sDown, "D down\nbefore bugfix right")
491+
System(sLeft, "E left\nbefore bugfix up")
492+
493+
Lay_U(a, sUp)
494+
Lay_R(a, sRight)
495+
Lay_D(a, sDown)
496+
Lay_L(a, sLeft)
497+
498+
HIDE_STEREOTYPE()
499+
@enduml
500+
```
501+
502+
![bugfix changes old layout](https://www.plantuml.com/plantuml/png/NP3FQeGm6CJlFaMw9uMkNdhgQQqABQHTySzXeI1HemPY3CaNjllsJR8NyPOPVZFVa8i6ei2iF7XXOk1cf6W1aFezIHIvnpE3nVH6KpLi0gY0UDZMH78YNEQiOUIiJxAtS-cizXidAz50bRMwp2O84rJ5qlNZz7PjcmwdFtcTfMKHHa5GKgKt4P9NT4fFKL0_R7ODTIkjyO6C_1KzdJP5KM_cYVqXJYVOSHMR5x1eXfHx7UbnkuiTdLjfuTpxHzONx61C9zTS-9D7s4XB1fWykjPjjtiZhogl_AgdaJl37tvgxBJljldFhxpewgQeYcjpy_zneM8qA_y7 "bugfix changes old layout")
503+
504+
The new repositioning of the elements could damage old diagrams.
505+
Therefore a compatibility mode NO_LAY_ROTATE is introduced.
506+
This mode can be directly activated in the old diagrams with `!NO_LAY_ROTATE=1`
507+
or with the additional command line argument `-DNO_LAY_ROTATE=1` (like `java -jar plantuml.jar -DNO_LAY_ROTATE=1 ...`)
508+
509+
If this value is set then non of the Lay_*() calls itself has to be updated like below.
510+
511+
```plantuml
512+
@startuml
513+
' the bugfix is deactivated with following statement
514+
!NO_LAY_ROTATE = 1
515+
516+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
517+
LAYOUT_LANDSCAPE()
518+
519+
Person(a, "A")
520+
System(sUp, "B up\nbefore bugfix left")
521+
System(sRight, "C right\nbefore bugfix down")
522+
System(sDown, "D down\nbefore bugfix right")
523+
System(sLeft, "E left\nbefore bugfix up")
524+
525+
Lay_U(a, sUp)
526+
Lay_R(a, sRight)
527+
Lay_D(a, sDown)
528+
Lay_L(a, sLeft)
529+
530+
HIDE_STEREOTYPE()
531+
@enduml
532+
```
533+
534+
![deactivated bugfix reproduces old layout](https://www.plantuml.com/plantuml/png/NP1HQxim5CNVyobk-_9luT_AO4-3GPqA6xXQh3uK1X8rQa2Z93Tp_VQxfZ1Att8EltFFpJqOv1hjqBD_0DW9A6tRo1-G1ch1AvJV74KDiyGEch7lnrcg5WoIEmY5R7LCYjY_56cI-La4h_34s4ggghUrW0vnCY-Uf_cyRsc2BQqHkXeLKdHVZOCtzLmjxJk3TIzBBtZUdHOh_uozWHiKcgmYe0INIkZzH2oZlYJFgFOOdWF_56ssZ9s4DgFQyF-mzjTRThvITjYOV2BZ3UpqfKhHZFhlVxrey8vBPTiXeG7evVL8r-EixkYG9C6XynzPD-0EZgc9uCXLFi9s8fB5_5hao-wqxzQfr2ctrSq8dR4KttIyQ3URykyVOLISioYDakpYxd4GggPJ_G80 "deactivated bugfix reproduces old layout")
535+
467536
## Global Layout Options
468537

469538
C4-PlantUML also comes with some layout options to make it easy and reusable to create nice and useful diagrams:
@@ -1006,7 +1075,7 @@ Source: [C4_Container Diagram Sample - message bus.puml](samples/C4_Container%20
10061075

10071076
![messagebus](https://www.plantuml.com/plantuml/png/ZLLDR-Cs4BtxLqpT0dK09yOMFHK8iFumkhjm4gzbOoy5Z94qbeYbI8Aad7MB_lSE9LjX4WLD3Z4vd7dlpGUfZywZzNKb1py9bSaw9oYzD-wFoSJYuqqXV5cdjIERQUL9-PjCLnCZKOMOQ-TpATB9_FVhTJ3jxbQJ2fqdowRzd2DGAB8t9k3_2hNYu8f1m9S41osbVXIg0CbEW2g7PyV2EbvfO7AGEaCfJupHgNnDC9Zc-L9IGDXYCHfM8hCw8NiK6Gt7y8ihqT3jKXIbJqHEUHBseoi-IOkvbjhU3kVQgWEh8ZkJTHDqO8xpuMCfV6EJL93Aj_J3txOau5gMlnG5T701VdZrKf3psc8HQTdeMh7dJF_eqI8ReTzFRobX_47owU7RVhtS90_t-uVTTlNvVZbYyvgiqsgKrSnOaHt3l5iDft0nDm0dxbQrdmKXQ4-Zx0ExNBpXipfeMw4NMWslu9y1y5zNz14Q4pjFZP4YQvtP_WMFw38hZ1_3L1MrH1lCqz1qrsbmeSCLAYmeT5rOC5OVXEJiNh1T8lRdMiVKNPDRsZ4aneR1ccdjWt5R4XWjb0Tz0CmoSWuuiqu5Y2XHBhN7mi4jn1FqMb35A2nxdzQEAUxQ7Sng5nWtcAR2ttrjs2qgPxJr3IUx2nK4q96KTwzWBGLNLXybkhdOuamtTNeAltDBwCc12Xb8uIY773qsPBOBDBKrsf5xTtfOvy976gPX7_FFVvxSt2-tORcs-YXorg1jWKguff3NZso21YO8E60c92_VBs6HFZKzJ-D-Bz1ZYgwHyM0namGVVil2Bl7QallVnhOtiOSnAZzJnfMFEUzEoTTLH8UNulzDEHp9EgPhHatAhjzFJS4SIftrzAPNONzR-3HgIjW5EKiUgMxRgOjg09Zgsfz73to97aey4lypXXJb_Gh-7Gms9FUBw45fx_wk5JtyjDsk4tOykpM7FVTrPxW6RtG7GfcA08RkfB8nVE4tRV8CUDVp1hGw4bAvwxBI0UKRfOdElfFdwBU2enlSWNJQwaPi1DhWzA34CzhLl6csQ1_2nMn-Jk7vcz5tqzyd8ePfRzZx8IvIUjWxKsygBVKBjdWSkuYMguqPhF2qt_ImFTTz-PQjbdykxnVy3Vl8MTIL_0y0 "messagebus")
10081077

1009-
### (C4 styled) Sequence diagram
1078+
### (C4 styled) Sequence diagram sample
10101079

10111080
TODO: better sample is missing ...
10121081

Themes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ Therefore we started with the convention that all C4-PlantUML compatible themes
4646
bases on the [`united`](https://raw.githubusercontent.com/plantuml/plantuml/master/themes/puml-theme-united.puml) theme
4747
and contains all additional required C4-PlantUML settings that it can be directly used in all C4-PlantUML diagrams).
4848

49+
> [!WARNING]
50+
> The !theme statement has to be BEFORE the !include statements.
51+
4952
E.g. in order to invoke theme `C4_united` from a remote repository, you have to use the following directive:
5053

5154
```plantuml

percy/TestLayoutLandscapeWithLay.puml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@startuml
2+
3+
' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
4+
!if %variable_exists("RELATIVE_INCLUDE")
5+
!include %get_variable_value("RELATIVE_INCLUDE")/C4_Container.puml
6+
!else
7+
' !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
8+
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
9+
!endif
10+
11+
LAYOUT_LANDSCAPE()
12+
13+
' C4-PlantUML v2.12 fixed a missing rotation bug in Lay_* calls in combination with LAYOUT_LANDSCAPE call
14+
' (details see https://github.com/plantuml-stdlib/C4-PlantUML/issues/376)
15+
' If older diagrams should remain unchanged the bugfix can be deactivated with following statement
16+
' !NO_LAY_ROTATE = 1
17+
' Or if the conversion is started via command line with following argument
18+
' -NO_LAY_ROTATE=1
19+
' like
20+
' java -jar plantuml.jar -NO_LAY_ROTATE=1 ...
21+
22+
'!NO_LAY_ROTATE = 1
23+
24+
Person(x, "X")
25+
System(sUp, "S up")
26+
System(sRight, "S right")
27+
System(sDown, "S down")
28+
System(sLeft, "S left")
29+
30+
Rel_U(x, sUp, "uses")
31+
Rel_R(x, sRight, "uses")
32+
Rel_D(x, sDown, "uses")
33+
Rel_L(x, sLeft, "uses")
34+
35+
Person(a, "A")
36+
Person(bUp, "B up")
37+
Person(cRight, "C right")
38+
Person(dDown, "D down")
39+
Person(eLeft, "E left")
40+
41+
Lay_U(a, bUp)
42+
Lay_R(a, cRight)
43+
Lay_D(a, dDown)
44+
Lay_L(a, eLeft)
45+
46+
HIDE_STEREOTYPE()
47+
@enduml
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
@startuml
2+
3+
' convert it with additional command line argument -DRELATIVE_INCLUDE="./.." to use locally
4+
!if %variable_exists("RELATIVE_INCLUDE")
5+
!include %get_variable_value("RELATIVE_INCLUDE")/C4_Container.puml
6+
!else
7+
' !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
8+
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
9+
!endif
10+
11+
LAYOUT_LANDSCAPE()
12+
13+
' C4-PlantUML v2.12 fixed a missing rotation bug in Lay_* calls in combination with LAYOUT_LANDSCAPE call
14+
' (details see https://github.com/plantuml-stdlib/C4-PlantUML/issues/376)
15+
' If older diagrams should remain unchanged the bugfix can be deactivated with following statement
16+
' !NO_LAY_ROTATE = 1
17+
' Or if the conversion is started via command line with following argument
18+
' -NO_LAY_ROTATE=1
19+
' like
20+
' java -jar plantuml.jar -NO_LAY_ROTATE=1 ...
21+
22+
!NO_LAY_ROTATE = 1
23+
24+
Person(x, "X")
25+
System(sUp, "S up")
26+
System(sRight, "S right")
27+
System(sDown, "S down")
28+
System(sLeft, "S left")
29+
30+
Rel_U(x, sUp, "uses")
31+
Rel_R(x, sRight, "uses")
32+
Rel_D(x, sDown, "uses")
33+
Rel_L(x, sLeft, "uses")
34+
35+
Person(a, "A")
36+
Person(bUp, "B up")
37+
Person(cRight, "C right")
38+
Person(dDown, "D down")
39+
Person(eLeft, "E left")
40+
41+
Lay_U(a, bUp)
42+
Lay_R(a, cRight)
43+
Lay_D(a, dDown)
44+
Lay_L(a, eLeft)
45+
46+
HIDE_STEREOTYPE()
47+
@enduml

samples/C4CoreDiagrams.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The following samples are reproductions with C4-PlantUML from [C4 model core dia
1818
- [Deployment Diagram](#deployment-diagram)
1919
- [Styles](#styles)
2020
- [Icons](#icons)
21+
- [Themes](#themes)
2122

2223
## Core Diagrams
2324

@@ -82,3 +83,9 @@ Source: [C4_Container Diagram Sample - bigbankplc-styles.puml](C4_Container%20Di
8283
Source: [C4_Container Diagram Sample - bigbankplc-icons.puml](C4_Container%20Diagram%20Sample%20-%20bigbankplc-icons.puml)
8384

8485
![Container diagram for Internet Banking System](https://www.plantuml.com/plantuml/png/hLLDS-D44BtxLpJXWBVAZei2BfpMiGt94d-mSZRBITMIslQmenanFRBNHV7VwL5aoN8s5IYuUNgwNp-zVZr-onwTBtFT-qgPL9SPmSxxWdySZHmUhhVAxygaP7AfDPwClqvjFYeqcb0pP9zfbOmctmzN8VGmln_bo9wSXEA9LA0ovAwB2Z-ZZPnWEljmDraked_GnvS5Pkwxjf-Is-56CePSEEM9J-qoseSxRhhyj5oinu-pQ3cV_Q-DgXWUY6rEmnzwtq1f120N8F0xWetLsXwKsO8EBD1aqBbMZkMN1I40sgQezL4m6kcVgrPVjRADq6nBZIzUPzORyY_T_evxVEakvpzqpEJs5xqxOevUJI2p9sqBUagHhxiV_xPyMCVhvIgUBXyN_JTjR1p5qI-pzUHMWdNeyMvz6z_FVfujfXBiUUKrGICAP0gt3dCHsi6TyUGCURX1yobe7XtPKzxhhSYnDVsqP6zpSWEODB-knd0AWzrKGqcaUW07CGOKLI7gAWQOfhOqdg-4nnDqV2E13DsndtuhM9S4hjx0dpq0QFds3vJ4M1II_4W9Z8j2gnIzikPAGkza6WE82XV8ppzCGcnAMed0N55ZBxafr5ODTgh2JT_azE6hSQWDqnMoNGPSe5n5agPfkC8j1HQdxb7gLE47C7uoLGYldDshZ1XGwoztsuZdlGewANy4Rnj56VOAGuro81yEYRC7fWgrTkqpThbDbAPQedauDFmcNm_W8-OewdHvWLQvyfG1bmcJbpd-1vvF1A1wG2ZqULgWIwBJf9-XnmIPmf3gdo4_-lKUEcTl7N7OS0UEjegzgmOEoeXfy-ht07R8Eye0It5TwYWZunLg7WJJ4JDekvK3-VGwOER7PZUVIvXW-ebC9XgguE_LtPTjDhMIvjgwZgQlQ1Va4k1Gqf3ugrcAsMVVfnoLCAm2aZKRpkLSBsGeMyk0LDK4DSnLwYpRZOVPvtGdrY3W9lFqVaYBC_oQLzj1yCt6OKuNsz-E81Zuv8rK0istdGq2CB6bRuqnQ9P-0DwXOQnKE8r27eBtfCyUbdQz7vWuzBvThrUH97RpkC1NSpgh45BhTl62r7QNsFOngU3Qfw96ge8TCpGDaOyc7S2xQBaOdJTlM_xBolX6ibjYxMfqKTuJPWmRP_FgxJfKVwNWRK2kWQSt4u5iCC_qkB1K9B0CD0pH2gCbqdLVXyDbNSdYWBPzD5-l1AYZSgUywxjMcAf-LAlpSNxVYFDMIijS_mq0 "Container diagram for Internet Banking System")
86+
87+
## Themes
88+
89+
Source: [C4_Container Diagram Sample - bigbankplc-themes.puml](C4_Container%20Diagram%20Sample%20-%20bigbankplc-themes.puml)
90+
91+
![Container diagram for Internet Banking System](https://www.plantuml.com/plantuml/png/fLHDZzis4BthLqotXte1sKQ1d8gYoFgZJO9rrbrjcjoC4JMsYL2aG8xiB8h-zmvfhsGv0OAY9vjFCsyU7n_vEZ1wRckJ_GIyfvfWwrqDyrVZWYkZInWzxGb-E7sIMfPVox370EoW99WjVtzuN0B7AcsLQQkBkZ2vpKwzmhXfhMQgJWD-dR-QfW_Xjoph6lVCJVXbElLudEmqxzko3UILiona4-NgQMFGHhdZaEHDHUWwGXzMzzCQ0vCNQ3EN3jIM_AI9MyjOio7eKAWqxZpMi7KUtWgvjyGmG_jPsnqKpq7KPzcQV71sfDh0hYQVmxpxTtC7Bp2uRTfyATqv74KqDAaHJS80bNAjvN1pcsKdwirCW0hzyqZzB5pN0cvkuUyC07gzeoEL6smQAVv89TmrZT4AMJjx8z0xF60EHUEZ-DLVyuWjoEY3o4ZI0akjWhEDWBPAS3UtVDdu-av43YU71eMkaC-6nclSKPp-ChLGNZUSmvtTjGPzXDVU7NH50T2ORq_PjbP5wMWqFmExpia01usnHtkG3KFftJ6G_qfIxKfjwEp7AYuwKVCVS_Y4DOeLGp5WT9t25zeo4CkX_Gzn9m5GqK4hkfQtA4SLCfOOA9x3-MzKK_nv3uCrEqy1OiB1qqu7zkbCGLl9PPt-v_6cxKKtjhm7vQaYonfDo6EkA0GmRYSBOZNvogWIrMUobJYbOsJNRx-Td8MJCj_t3PpxZaFH526MqVzqwLv-uH7LgCqc943ebkELhE5K4FdZew8JDHfOQULTS5k6vHUrHxiZE7KAxGNdMK7FAfnswx6cgwlRcvjIU3vh9K2tYmkB0KlNSd_GUNTZSs2FDc3QRszozaZcubNex-Q7G27EVlFqj2waS5WN6lnkpI3QiVGyRlEUz6vVklubI7JzFJyp9N1mxDr03CzMvV2kU7W_lHpUZ_oFdPkPLFV2-j0FMHu9gv3U_FJm7Brc2i0kCf-95xEvK7QS5tvSnQWGsW0qZcZYw8KC4dUjOTZN1ab0FxvOFQs5QE3oe7sOkzwOr3yzk_DfTT-PanLl7ZvkxfT_BDylHhVPQs5gQ_Cl "Container diagram for Internet Banking System")
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@startuml
2+
' theme from C4-Stdlib (The !theme statement has to be BEFORE the !include statements.)
3+
!theme C4_united from <C4/themes>
4+
5+
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Container.puml
6+
7+
title Container diagram for Internet Banking System
8+
9+
Person(customer, Customer, "A customer of the bank, with personal bank accounts")
10+
11+
System_Boundary(c1, "Internet Banking") {
12+
Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA")
13+
Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to customers via their web browser")
14+
Container(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device")
15+
ContainerDb(database, "Database", "SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.")
16+
Container(backend_api, "API Application", "Java, Docker Container", "Provides Internet banking functionality via API")
17+
}
18+
19+
System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system")
20+
System_Ext(banking_system, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")
21+
22+
Rel(customer, web_app, "Uses", "HTTPS")
23+
Rel(customer, spa, "Uses", "HTTPS")
24+
Rel(customer, mobile_app, "Uses")
25+
26+
Rel_Neighbor(web_app, spa, "Delivers")
27+
Rel(spa, backend_api, "Uses", "async, JSON/HTTPS")
28+
Rel(mobile_app, backend_api, "Uses", "async, JSON/HTTPS")
29+
Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC")
30+
31+
Rel_Back(customer, email_system, "Sends e-mails to")
32+
Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP")
33+
Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS")
34+
35+
SHOW_LEGEND()
36+
@enduml

0 commit comments

Comments
 (0)