PlantUML profile

UML: Unified Modeling Language (UML) is an off-patent third generation Modeling and specification Language. UML is an open method for illustrating, visualizing, building, and writing artifacts of an under development, object-oriented, software-intensive system. (From Wikipedia)

PlantUML uses simple readable text description statements to draw diagrams. Note that it does not prevent you from drawing diagrams that contradict each other (for example, having two classes that inherit from each other), so it is more of a drawing tool than a modeling tool. (What’s the goal of PlantUML?)

I. Required environment

  • JDK(Java SE Development Kit)
  • graphviz
  • Visual Studio Code(or Sublime, Chrome, Eclipse, AndroidStudio, Intellij… More)

Configuration of two.

1. Install the JDK

  • Check whether JDK terminal input is installed
java -version
Copy the code

It will pop up if it’s not installed

Click on more information to go to the JDK Download page

Click on the DOWNLOAD

Enter the Download page

Click accept the terms, click again. DMG link to download

For some reasons, Oracle JDK download is slow. You can use huawei JDK image source to download the latest version of JDK. For details about JDK environment variables configuration, see JDK11 Installation and Environment variable configuration summary in macOS

After the installation and configuration is complete, run the terminal

java -version
Copy the code

It’s going to look something like this

2. Install graphviz

Graphviz is an open source image rendering library that converts PlantUML scripts into images.

Terminal input

brew install graphviz
Copy the code

There are several dependency packages coming down, so it will take some time, be patient

3. Install the plantUML plug-in with VSCode

  • Open the VSCode
  • ⌘(command) + shift + X to open the extension, search PlantUML
  • Choose the one with the most stars, usually the first

  • install

Use 4.

  • Create a new file
  • Enter the sample
@startuml title Sequence diagram == Authentication stage == Alice -> Bob: request Bob -> Alice: reply == data upload == Alice -> Bob: data upload note left: This is the note shown on the left Bob --> Canny: Transfer data... No more than 5 seconds... Canny --> Bob: status return note Right: This is the note shown on the right Bob -> Alice: status return == Status display == Alice -> Alice: Send yourself a message @endUMLCopy the code

Save the file as test.wsd

  • Alt + D to the right to render the UML diagram

Other development tools are configured using PlantUML

  • Using PlantUML in AndroidStudio (for Mac)

  • Mac uses Sublime + PlantUML for efficient drawing

  • In Mac environment, Intellij IDEA is installed to draw sequence diagrams using PlantUML

  • PlantUML Viewer 插件 logo 图 文

  • Information about the PlantUML Eclipse Plugin

  • Edit PlantUML with Atom in Mac OS X