PlantUML
Introduction
PlantUML is an open-source tool that enables the generation of diagrams from simple text descriptions. It supports a wide variety of diagram types, both UML-based and non-UML-based. PlantUML is particularly useful for developers, architects, and project managers, as it simplifies the creation and maintenance of diagrams and can be integrated into many development environments.
Possible UML-based Diagrams
Sequence Diagram
Description: A sequence diagram shows the interaction between objects in a specific order. It is frequently used to visualize the flow of messages between objects in a system.
Example in PlantUML:
@startuml
Alice -> Bob: Hello!
Bob --> Alice: Hello back!
@enduml
Explanation:
->shows a message from one object to another.-->shows a response.
Activity Diagrams
Description: Activity diagrams (also known as flowcharts) show the flow of activities and decisions in a process. They are particularly useful for visualizing business processes or algorithms.
Example in PlantUML:
@startuml
start
:Activity 1; :Activity 2;
if (Condition?) then (Yes)
:Activity 3;
else (No)
:Activity 4;
endif
stop
@enduml
Explanation:
startandstopmark the beginning and end of the process.ifandelseshow decisions.
Class Diagram
Description: Class diagrams show the structure of a system through classes, their attributes, methods, and the relationships between the classes.
Example in PlantUML:
@startuml
class Car {
-brand: String
-model: String +drive()
}
class Driver {
-name: String +steer()
}
Car "1" *-- "1" Driver
@enduml
Explanation:
-shows private attributes,+shows public methods.-->shows an association between classes.
Object Diagram
Description: Object diagrams show instances of classes at a specific point in time and their relationships to each other.
Example in PlantUML:
@startuml
object Car1 {
brand = "VW"
model = "Golf"
}
object Driver1 {
name = "Max"
}
Car1 --> Driver1
@enduml
Explanation:
objectdefines an instance of a class.-->shows a relationship between objects.
State Diagram
Description: State diagrams show the various states of an object and the transitions between these states.
Example in PlantUML:
@startuml
[*] --> Off
Off --> On : switch on
On --> Off : switch off
@enduml
Explanation:
[*]shows the start state.-->shows a transition between states.
Possible Non-UML-based Diagrams
Visualization of JSON/YAML Data
Description: PlantUML can visualize JSON or YAML data to better understand the structure and hierarchy of the data.
Example in PlantUML:
@startjson
{
"name": "Max",
"age": 30,
"address": {
"street": "Main Street 1",
"city": "Berlin"
}
}
@endjson
Explanation:
@startjsonand@endjsonenclose the JSON code.
Archimate Diagram
Description: Archimate diagrams are used to model enterprise architectures. They show the relationships between business processes, applications, and technologies.
Example in PlantUML:
@startuml
archimate #Business "Business Process" as bp
archimate #Application "Application" as app
bp --> app
@enduml
Explanation:
archimatedefines an Archimate element.-->shows a relationship between elements.
Gantt Diagram
Description: Gantt diagrams show project plans and the timeline of tasks.
Example in PlantUML:
@startgantt
[Task 1] lasts 5 days
[Task 2] starts at [Task 1]'s end and lasts 3 days
@endgantt
Explanation:
lastsdefines the duration of a task.starts atshows the start of a task relative to another.
Mindmap Diagram
Description: Mindmaps visualize ideas and concepts in a hierarchical structure.
Example in PlantUML:
@startmindmap
* Root
** Branch 1
*** Leaf 1
** Branch 2
@endmindmap
Explanation:
*shows the root node.**and***show child nodes.
Network Diagram
Description: Network diagrams show the structure and connections in a network.
Example in PlantUML:
@startuml
node "Server" as s
node "Client" as c
s -- c
@enduml
Explanation:
nodedefines a node in the network.--shows a connection between nodes.
Work Breakdown Structure (WBS)
Description: A Work Breakdown Structure (WBS) shows the hierarchy and structure of a project.
Example in PlantUML:
@startwbs
* Project
** Phase 1
*** Task 1
*** Task 2
** Phase 2
@endwbs
Explanation:
*shows the main project.**and***show sub-elements.
Further Information
Weblinks
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.