0% found this document useful (0 votes)
531 views2 pages

PlantUML Basic Syntax Cheatsheet

This document is a cheatsheet for PlantUML basic syntax, outlining the structure for creating diagrams, defining participants and actors, and illustrating message arrows. It covers various diagram types including use case, class, activity, and component diagrams, along with common relationships like association and inheritance. Each section provides examples to aid in understanding the syntax and usage of PlantUML.

Uploaded by

saifsultan5417
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
531 views2 pages

PlantUML Basic Syntax Cheatsheet

This document is a cheatsheet for PlantUML basic syntax, outlining the structure for creating diagrams, defining participants and actors, and illustrating message arrows. It covers various diagram types including use case, class, activity, and component diagrams, along with common relationships like association and inheritance. Each section provides examples to aid in understanding the syntax and usage of PlantUML.

Uploaded by

saifsultan5417
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PlantUML Basic Syntax Cheatsheet

1. Basic Diagram Structure


All diagrams must begin with @startuml and end with @enduml.
@startuml
' diagram content goes here
@enduml

2. Defining Participants & Actors


Use actor for external users and participant for system elements.
actor User
participant "LoginService" as LS

3. Message Arrows
Used in sequence diagrams. Arrows show direction of interaction.
User -> LS : login(username, password)
LS --> User : success/failure

4. Use Case Syntax


Use case diagrams show actor interactions with system functions.
actor Admin
usecase "Add Product" as UC1
Admin --> UC1

5. Class Syntax
Classes can contain attributes and methods. Use relationships to connect.
class Product {
+id: int
+name: string
+getPrice(): float
}

Product --> Category

6. Activity Diagram Elements


Use start, stop, and actions. Decision blocks use if/else/endif.
start
:Validate Input;
if (Valid?) then (yes)
:Process Order;
else (no)
:Show Error;
endif
stop

7. Component and Interface


Used in component diagrams to show software modules.
component "UI"
PlantUML Basic Syntax Cheatsheet

component "API"
UI --> API : calls REST endpoints

8. Common Relationships
Key symbols for inheritance, aggregation, dependency, etc.
A -- B : association
A <|-- B : inheritance
A *-- B : composition
A o-- B : aggregation
A ..> B : dependency

You might also like