PlantUML is a super awesome tool where you can specify your UML diagrams in a text format. It is open source and has a rich library to generate diagrams for all your UML needs. Here are my thoughts on why PlantUML is awesome. I prefer VSCode as my default editor and installing PlantUML for VSCode is a matter of installing few plugins. Here is what you need:

Now open a new document, paste the following code and save it as hello.puml, the valid extensions are *.wsd, *.pu, *.puml, *.plantuml, *.iuml, .txt

'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

Save the file and run it using Alt+D or open up the Command Palette (Ctrl+Shift+P) and type PlantUML, you would see the following:
VSCode_PlantUML1
Select the Preview Diagram option, now you can see the split pane with the diagram. You can edit the plantUML code and the image would render instantly giving an immediate feedback loop.
VSCode_PlantUML2

“Right tool for the right job is the essence of productivity”
-Rushi

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>