Want to learn how to create nice clean diagrams without dragging boxes all over the screen?
Ever wanted to write something like:

Keep reading and your dreams will come true!
The mark up from above is rendered by PlantUml engine: https://plantuml.com/
What can it do?
We`ve already seen sequence diagrams:
Swimlanes? Sure!

Tired of linking boxes for some hierarchy? Lets fix it

Rendering and exporting each diagram can be a bit annoying.
The good thing is, plantUML is nothing but a jar file, so you can use it in your proj build to generate images for all diagrams, just add:
Ask yourself, do you actually remember the uml convention?
Does your client know UML?
How do you define how deep in detail your diagram should go?
Are you following UML when you are explaining something to your colleague and drawing it on a piece of paper?
Can the process of visualizing architecture be as simple as a drawing on a napkin but look professional?
Some people tried to answer those questions and created a c4 model for software architecture https://c4model.com/
In short, we have 3 types of diagrams (well 4 but no one uses code one)
1) High-level overview: Context diagram - to show how other systems or people interact with yours
2) Container diagram - your apps and services (zoom in from context)
3) Component diagram - contents of your app(s)
(Read a page, that 5 minutes will change your life and make you an architect)
Now, how do we combine c4 and planutUml?
Easy - we need c4-plantUML!
https://github.com/RicardoNiepel/C4-PlantUML

Congratulations! you are an architect!
Oh, wait - add snippets to VS Code:
https://github.com/RicardoNiepel/C4-PlantUML/blob/master/.vscode/C4.code-snippets
Ok, now you are! Enjoy it :)
Client -> Server: Authentication RequestAnd get:

Keep reading and your dreams will come true!
PlantUML
First, install plantUml with choco:choco install plantumlNext thing, we need an editor, VS Code plugin is quite good:
ext install plantumlAnd you are ready!
The mark up from above is rendered by PlantUml engine: https://plantuml.com/
What can it do?
We`ve already seen sequence diagrams:
@startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response @endumlBut, basically, it can do any.
Swimlanes? Sure!
@startuml |Swimlane1| start :foo1; |#AntiqueWhite|Swimlane2| :foo2; :foo3; |Swimlane1| :foo4; |Swimlane2| :foo5; stop @enduml

Tired of linking boxes for some hierarchy? Lets fix it
@startmindmap * Debian ** Ubuntu *** Linux Mint *** Kubuntu *** Lubuntu *** KDE Neon ** LMDE ** SolydXK ** SteamOS ** Raspbian with a very long name @endmindmap

Rendering and exporting each diagram can be a bit annoying.
The good thing is, plantUML is nothing but a jar file, so you can use it in your proj build to generate images for all diagrams, just add:
java -jar "plantuml.jar" "folder"
C4
But that's not all.Ask yourself, do you actually remember the uml convention?
Does your client know UML?
How do you define how deep in detail your diagram should go?
Are you following UML when you are explaining something to your colleague and drawing it on a piece of paper?
Can the process of visualizing architecture be as simple as a drawing on a napkin but look professional?
Some people tried to answer those questions and created a c4 model for software architecture https://c4model.com/
In short, we have 3 types of diagrams (well 4 but no one uses code one)
1) High-level overview: Context diagram - to show how other systems or people interact with yours
2) Container diagram - your apps and services (zoom in from context)
3) Component diagram - contents of your app(s)
(Read a page, that 5 minutes will change your life and make you an architect)
Now, how do we combine c4 and planutUml?
Easy - we need c4-plantUML!
https://github.com/RicardoNiepel/C4-PlantUML
@startuml
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Container.puml
System(systemAlias, "System", "System Description")
Container(containerAlias, "Container", "Technology", "Optional Description")
Rel(systemAlias, containerAlias, "Action", "Optional Technology")
@enduml

Congratulations! you are an architect!
Oh, wait - add snippets to VS Code:
https://github.com/RicardoNiepel/C4-PlantUML/blob/master/.vscode/C4.code-snippets
Ok, now you are! Enjoy it :)
Comments
Post a Comment