当前位置:网站首页>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
边栏推荐
- The principle, testing and Countermeasures of malicious software reverse closing EDR
- 思科考试--冗余网络
- Kubernetes create service access pod
- "Trust machine" empowers development
- El input text field word limit, beyond which the display turns red and input is prohibited
- 104. SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目
- MySQL中对于事务的理解
- [MySQL] index classification
- redis配置文件中常用配置详解[通俗易懂]
- [daily training] 326 Power of 3
猜你喜欢

Single step debugging analysis of rxjs observable of operator

思科--WAN 的概念考试外部工具

14年本科毕业,3个月转行软件测试月薪13.5k,32的岁我终于找对了方向

MySQL -- deduction of index storage model

使用3DMax制作一个象棋棋子

Kubernetes create service access pod

Chen Tianqi's machine learning compilation course (free)

转--拿来即用:分享一个检查内存泄漏的小工具
![[untitled]](/img/60/9a56e8b00c386779be13308515b24f.png)
[untitled]

轉載csdn文章操作
随机推荐
MySQL5.7 设置密码策略(等保三级密码改造)
[jetcache] how to use jetcache
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received
Pytorch nn.functional.unfold()的简单理解与用法
leetcode - 287. Find duplicates
Preparation of functional test report
Ffmpeg learning notes
ECMAScript 2022 was officially released. Have you heard about it?
Appium automated testing foundation - Supplement: introduction to desired capabilities parameters
447 Bili Bili noodles warp 1
思科--高可用和高可靠网络考试
Tourism Management System
Multi picture alert ~ comparison of Huawei ECs and Alibaba cloud ECS
Rust语言——小小白的入门学习05
Understanding of transactions in MySQL
【c语言】malloc函数详解[通俗易懂]
半监督学习之数据增强
Selection of all-optical technology in the park - Part 2
Turn -- bring it and use it: share a gadget for checking memory leaks
el-input文本域字数限制,超过显示变红并禁止输入