PlantUML

Introduction

PlantUML allows the definition of diagrams using simple and human readable text description. Visualizations can then be generated in different image formats. So PlantUML diagrams are “Diagrams as Code” using the PlantUML syntax.

Benefits of PlantUML

  • Syntax: text is more manageable than binaries
  • Layout: Auto layout on generation
  • Versioning: Track changes by a version control system (git with merge possible), keep UML source together with code or documentation (Wiki)
  • Sharing, copy & paste, integrate with other systems
  • Writing can be easier than drawing, for speed and ease. Almost like programming.
Maintaining (UML) documentation can be a tedious task. Separate diagramming tools are often separate from development tools. PlantUML can be an integral part of the tools we love and use
Source: PlantUML introduction (slideshare.net)

https://blog.anoff.io/2018-07-31-diagrams-with-plantuml/

Getting Started

Sample

A sample for a PlantUML sequence diagram.

@startuml Hello World
Client -> Server: Request
Server --> Client: Response

Client -> Server: Another Request
Server <-- Client: Another Response
@enduml

PlantUML Syntax:</p>
<p>@startuml Hello World<br />
Client -> Server: Request<br />
Server –> Client: Response</p>
<p>Client -> Server: Another Request<br />
Server <– Client: Another Response<br />
@enduml</p>
<p>

Installation

  1. Install PlantUML and its dependencies with choco install plantuml.
  2. Install PlantUML extension info Visual Studio Code.

Rendering Engine

There are different rendering engines available. In some cases it can be beneficial that no tool needs to be installed or sometimes it will also produce slightly different results and provide the benefit to choose the better fitting.

  • GraphViz is a command line tool which needs to be installed
  • jdot without an installation needed. Just add !pragma graphviz_dot jdot to the top of the diagram

Some additional information and a sample can be found at How to use PlantUML without Graphviz – Docs-as-Code (docs-as-co.de).

https://allthingscompute.dev/2020/04/14/plantuml-and-c4-modelling/

Further Resources

Information

Usage Documentation and Samples

Workflows

  • Server-side image generation in Azure DevOps at [TODO: Link to Presentation, https://www.youtube.com/watch?v=Zt3Bj1HMJ8g]
  • Client-side image generation approach at PlantUML in Azure DevOps Wiki.

      Current

      •  PlantUML
        • Introduction
        • Sample
        • Other Resources
      • PlantUML Syntax Cheet Sheet
        • Relationships
      • PlantUML Syntax
        • Plain vs. Extensions
      • PlantUML Usage Experiences
        • Getting Started
          • Hello World
          • Usage
        • C4 PlantUML
        • Azure PlantUML
        • Further Resources
      • PlantUML Diagram Generation using Azure DevOps Pipelines
      • PlantUML Installation

      Draft