DEV Community

Hannah (she/her)
Hannah (she/her)

Posted on

Making Plans with Plantuml

When it comes to building software, diagrams serve as a useful planning tool. One drawback with diagrams is the time it takes to create them. I like using Plantuml to create diagrams because it allows me to generate diagrams through text, saving me time.

To get started, you just need to have Java and Graphviz installed.
Download the plantuml.jar file and keep it handy, you'll need it later.

Then, create a text file and use the Plantuml language to specify the information you would like to include in your diagram.

The contents of ranch-manager.txt is below:

@startuml

title Ranch Manager DB

' hide the spot
hide circle

' avoid problems with angled crows feet
skinparam linetype ortho

entity User {
  id : number
  --
  name : text
}

entity Plant {
  id : number
  --
  name : text
}

entity Animal {
  id : number
  --
  name : text
}

note left of User #pink
 <size:15><&heart>This is evolving.<&heart></size>
end note

User }|..|{ Plant
User }|..|{ Animal

@enduml
Enter fullscreen mode Exit fullscreen mode

Next, run the Plantuml program that converts the text into a diagram and specify the text file you already created.

java -jar plantuml.jar ranch-manager.txt

And voila! The ranch-manager.png below is generated for you. No dragging, dropping, or color picking required.

diagram of ranch manager database

Once you learn the language specifications, it's easy to generate a variety of diagrams through text.

Now your brain can put the extra time toward creative thinking and generating your next big idea.😻

Clown cat drinking tea

Top comments (4)

Collapse
 
waylonwalker profile image
Waylon Walker

This kind of reminds me of mermaid

Collapse
 
ketoaustin profile image
Hannah (she/her)

I had not heard of Mermaid before, but it does look similar. I will try it out too.

Collapse
 
botanical profile image
Jennifer Tran

I love the explanation and the illustration! Thanks for sharing πŸ™‚ have you ever used this website: planttext.com/ to generate diagrams?

Collapse
 
ketoaustin profile image
Hannah (she/her)

Thanks, Jennifer! I haven’t used it, but it looks awesome!