PlantUML can be used to create several UML diagram types from a simple text file description. It can run from command line, editor (e.g. VSCode plugin), browser (e.g. Chrome browser) or online service via browser.
Bring architecture closer to the code so that it is in sync with the code:
https://real-world-plantuml.com/ gives many examples of PlantUML diagrams.
example of a sequence diagram I created
VSCode Plantuml Extension makes it easy to create and edit plantuml diagrams. It includes a real-time preview.
C4 templates exist to create PlantUML diagrams according to the C4 template.
For each of the template files C4Context.puml, C4Context.puml, C4_Component.puml comment out the includeurl, and uncomment the include, directive.
' !includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
' uncomment the following line and comment the first to use locally
!include C4_Container.puml
VSCode supports snippets that predict words as you type. VSCcode Snippets for C4 can be installed per See https://github.com/RicardoNiepel/C4-PlantUML#snippets-for-visual-studio-code
Some standard libaries are available for PlantUML. See http://plantuml.com/stdlib for what is supported in official release of PlantUML.
Plantuml for AWS uses the icon set from AWS and converts these to sprites for use with PlantUML.
git clone git@github.com:milo-minderbinder/AWS-PlantUML.git
PlantUML supports sprites (small graphic elements). Given we want to make diagrams communicate quickly and clearly, using sprites (rather than just boxes) is very effective.
Some good examples of where PlantUML Sprites are used:
It's easy to create your own sprites from existing icons.
Download plantuml.jar
java -jar plantuml.jar -encodesprite 4 images/C4person100.png > C4person4.sprite
java -jar plantuml.jar -encodesprite 16 images/C4person100.png > C4person16.sprite
java -jar plantuml.jar -encodesprite 8 images/C4person100.png > C4person8.sprite
See source code
@startuml
sprite $C4person100Small [16x16/16] {
0000004774000000
0000067777600000
0000377777720000
0000477777740000
0000377777730000
0000077777600000
0244467777644420
3777777777777773
6777777777777776
7777777777777777
7777777777777777
7777777777777777
7777777777777777
7777777777777777
5777777777777774
0477777777777640
}
sprite $C4person100Big [100x100/16] {
0000000000000000000000000000000000000000000013456666543100000000000000000000000000000000000000000000
# removed rest of sprite here for clarity
Bob : <$C4person100Small> Small
Alice : <$C4person100Big> Big
Alice -> Bob
@enduml
PlantUML supports hyperlinks in output SVG images. This allows diagrams to be linked together, and for a user to easily navigate by clicking around per Shneiderman's mantra:
Overview first, zoom and filter, then details-on-demand
@startuml
actor Bob [[http://plantuml.com/sequence-diagram]]
actor "This is [[http://plantuml.com/sequence-diagram Alice]] actor" as Alice
Bob -> Alice [[http://plantuml.com/index]] : hello
note left [[http://plantuml.com/index]]
a note with a link
end note
Alice -> Bob : hello with [[http://plantuml.com/index{Tooltip for message} some link]]
note right [[http://plantuml.com/index]] : another note
note left of Bob
' You can use [[http://plantuml.com/index links in notes]] also.
end note
@enduml