当前位置:网站首页>Introduction and use of plantuml
Introduction and use of plantuml
2022-07-01 22:55:00 【birdyson】
Introduce
Easy to use free drawing plug-ins , compatible vscode、IDEA Wait for big names IDE, Automatically generate by writing code UML graphics . Official Chinese documents :https://plantuml.com/zh/
Installation mode
With IDEA For example , Directly in Plugin -> Marketplace Just install it in ,vscode Empathy .
introduction
Create a new file in the file directory , You can see PlantUML File, Create a new file , Choose what you need UML graphics .
UML Drawing syntax rules
Global rules
Scope
puml You need to write the code in @startuml And @enduml It can only take effect between .
Sequence diagram
arrow
@startuml
Client -> Server: Establishing a connection
' ↓ Here, for readability, it can also be written in reverse : <--
Server --> Client: Data interaction
Client --> Server: Data interaction
Server -> Client: disconnect
@enduml

Arrow pattern :
| No | Field | Express |
|---|---|---|
| 1 | x | Lost information , At the end of the arrow is x |
| 2 | > | Solid arrows |
| 3 | >> | Modest arrow |
| 4 | - | Solid line |
| 5 | – | Dotted line |
| 6 | <-> | Double arrow |
Declare participants
You can declare participants , Change properties for participants 、 Give alias as( Once the alias is given, the original name cannot be used later )、 Set weight order( The smaller the number, the higher ).
@startuml
participant Client as c order 1
participant Server as s order 2
c -> s: Establishing a connection
s --> c: Data interaction
c --> s: Data interaction
s -> c: disconnect
@enduml
Participant attributes that can be used :
| No | Field | Express |
|---|---|---|
| 1 | participant | participants |
| 2 | actor | role |
| 3 | control | control |
| 4 | entity | Entity |
| 5 | database | database |
| 6 | collections | aggregate |
| 7 | queue | queue |
| 8 | boundary | The border |

Text alignment
skinparam sequenceMessageAlign center
Message number
autonumber 1.1, Specify a self incrementing number , Add the last number by default , Self incrementing digits can be specified .
@startuml
'https://plantuml.com/sequence-diagram
participant Client as c order 1
participant Server as s order 2
autonumber 1.1
c -[#red]> s: Establishing a connection
autonumber inc A
s --> c: Data interaction
c --> s: Data interaction
autonumber inc A
s -> c: disconnect
@enduml

notes
note left:、 note right: Single line comments or use note left ... endnote Multiline comment .

Separator
== repeat == or ... repeat ...

spacing
||| Set the spacing , Or specify spacing ||45||

Lifeline
activate c Initialize life ,deactivate c End the lifeline , You can nest .

return
Lifeline can return content , Use return return , At the same time, it can cooperate with autoactivate Realize automatic lifeline declaration and destruction .
Create quickly 、 The destruction 、 Lifeline / example
@startuml
alice -> bob ++ : hello
bob -> bob ++ : self call
bob -> bib ++ #005500 : hello
bob -> george ** : create
return done
return rc
bob -> george !! : delete
return success
@enduml

It can also be done at the same time :
@startuml
alice -> bob ++ : hello1
bob -> charlie --++ : hello2
charlie --> alice -- : ok
@enduml

Activity diagrams
arrow
-->Represents ordinary arrow-[labels]->Represents the arrow with label-left->Arrow that specifies the direction (down, up, left, right)
Start and end
(*)Start / endstart/stopStart / end
边栏推荐
- cvpr2022 human pose estiamtion
- 阿洛迷茫后的思考
- Turn -- use setjmp and longjmp in C language to realize exception capture and collaboration
- 思科考试--冗余网络
- Réimpression de l'article csdn
- 正则系列之组和范围(Groups and Ranges)
- Fiori applications are shared through the enhancement of adaptation project
- Cutefishos system~
- MySQL中对于事务的理解
- MySQL -- index of MyISAM storage engine
猜你喜欢

Rust language - Introduction to Xiaobai 05

“信任机器”为发展赋能
![[target tracking] | single target tracking indicator](/img/07/033d5c07b07e3443330840e98940b3.png)
[target tracking] | single target tracking indicator

Turn -- use setjmp and longjmp in C language to realize exception capture and collaboration

Chen Tianqi's machine learning compilation course (free)

map容器

The fixed assets management subsystem reports are divided into what categories and which accounts are included

I graduated from college in 14 years and changed to software testing in 3 months. My monthly salary was 13.5k. At the age of 32, I finally found the right direction

Flynk SQL client uses comparison and is familiar with official documents
![[untitled]](/img/60/9a56e8b00c386779be13308515b24f.png)
[untitled]
随机推荐
Explain ThreadLocal in detail
转--深入LUA脚本语言,让你彻底明白调试原理
Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
[image segmentation] 2021 segformer neurips
tcpdump命令使用详解
Digital currency: far-reaching innovation
Origin2018 installation tutorial "recommended collection"
Flynk SQL client uses comparison and is familiar with official documents
Operation category read is not supported in state standby
2020-ViT ICLR
思科考试--冗余网络
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received
使用 EMQX Cloud 实现物联网设备一机一密验证
MySQL -- index of InnoDB storage engine
多图预警~ 华为 ECS 与 阿里云 ECS 对比实战
MySQL -- deduction of index storage model
cvpr2022 human pose estiamtion
聊一聊Zabbix都监控哪些参数
Friendly serial assistant tutorial_ How to configure friendly serial port debugging assistant - tutorial on using friendly serial port debugging assistant
Deadlock handling strategies - prevent deadlock, avoid deadlock, detect and remove deadlock