PlantUML is an open source tool where you can specify your UML diagrams in a text format. Diagrams are defined using a simple and intuitive language.
All popular IDE’s and Text editors have PlantUML plugins.Here is a post on installing PlatUML for VSCode.The advantages far outweigh the very minor hiccup of learning the PlantUML language syntax. Now the team has an incredible advantage of performing version control of every UML diagram associated with the project. Once you get a hang of writing UML this way, the understanding of your diagrams feels more declarative and intuitive. To draw an analogy, this is very similar to using EMMET for coding your webpages. The biggest advantage is now everyone can read UML as code.

Here is a basic example(You can try online):

'Everything that starts with a simple quote 'is a comment. You can also put comments on several lines using/'to start and '/to end.

'Start of UML diagram
@startuml
header Awesome PlantUML
footer Page %page% of %lastpage%

title Sequence Diagram
' Scale determines the size of the output
scale 1

' A single dash in the arrow gives solid line
Alice -> Bob: Authentication Request

' A double dash in the arrow gives dotted line
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
' End of UML diagram

PlantUML

Although there are other text formats for UML modelling, Plant UML is one of the most popular formats: It supports many diagram types, automatically lays out your diagram elements, and has a simple, human-readable language.

PlantUML uses the Graphviz software to layout your diagram where the layout algorithm aims connectors in the same direction (top to bottom, or left to right) and attempts to avoid crossed or connectors to make the diagram more readable. Graphviz DOT code can also be used to create flow charts, graphs and more.

PlantUML can do the following:

The following non-UML diagrams are also supported:

Installing PlantUML Locally:
You need the following to run PlantUML:

  • Java
  • Graphviz (optional if you only need sequence diagrams and activity (beta) diagrams)

Now download plantuml.jar and run it to open PlantUML's graphical user interface.

Run PlantUML from the command line

  1. First, create a text file with PlantUML commands, like this example called sequenceDiagram.txt
        @startuml
        Alice -> Bob: test
        @enduml
    
  2. Then, run (or have your software call) PlantUML, using sequenceDiagram.txt as input. The output is an image, which either appears in the other software, or is written to an image file on disk.
    java -jar plantuml.jar sequenceDiagram.txt

    This outputs your sequence diagram to a file called sequenceDiagram.png.

“To build a software that your users understand, capture the language of that users in a class diagram.”
-Michael Jesse Chonoles, UML 2 for Dummies

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>