Generating UML Diagrams in IntelliJ IDEA with PlantUML Plugin

Generating UML Diagrams in IntelliJ IDEA with PlantUML Plugin

Takahiro Iwasa
Takahiro Iwasa
2 min read
IntelliJ IDEA PlantUML

Introduction

Generating UML diagrams can greatly enhance your software design process. With IntelliJ IDEA and the PlantUML Integration, you can create and manage diagrams efficiently using a simple text-based DSL. This text-based approach allows seamless integration with version control systems like Git.

Prerequisites

Ensure the following software is installed and configured:

SoftwareVersion
IntelliJ IDEA2016.3.4
PlantUML Integration Plugin2.5.0
Graphviz2.3.8

Writing and Visualizing UML

To get started, create a file with a .puml extension. Begin coding your UML diagram, and the plugin will immediately render it in the IDE.

Here is a simple example:

@startuml

interface Person
abstract Employee

interface Person {
    + string getName();
}

class Employee {
    - string name;
    --
    + string getName();
    + string getEmployeeId();
}

Person <|-- Employee

@enduml

This code produces a UML diagram showcasing a Person interface and an Employee class. For more details about PlantUML DSL, refer to the official PlantUML website.

Benefits of Using PlantUML

  • Text-based simplicity: Manage UML diagrams as code, making them easy to track and version.
  • Integration with Git: Effortlessly manage changes and collaborate with others.
  • Immediate feedback: Visualize diagrams instantly as you type.

Conclusion

PlantUML is a powerful yet simple tool for generating UML diagrams in small- to mid-sized applications. Its text-based format, combined with tools like IntelliJ IDEA and Graphviz, makes it an excellent choice for developers looking for an efficient and version-controlled workflow.

Happy Coding! 🚀

Takahiro Iwasa

Takahiro Iwasa

Software Developer at KAKEHASHI Inc.
Involved in the requirements definition, design, and development of cloud-native applications using AWS. Now, building a new prescription data collection platform at KAKEHASHI Inc. Japan AWS Top Engineers 2020-2023.