当前位置:网站首页>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
/stop
Start / end
边栏推荐
- Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
- Explain kubernetes network model in detail
- Turn -- bring it and use it: share a gadget for checking memory leaks
- Single step debugging analysis of rxjs observable of operator
- Digital currency: far-reaching innovation
- 2020-ViT ICLR
- 【扫盲】机器学习图像处理中的深层/浅层、局部/全局特征
- Lc669. Prune binary search tree
- Favorite transaction code management tool in SAP GUI
- 【c语言】malloc函数详解[通俗易懂]
猜你喜欢
Map container
转--原来gdb的底层调试原理这么简单
[untitled]
转载csdn文章操作
Preparation of functional test report
Mysql5.7 set password policy (etc. three-level password transformation)
3DE resources have nothing or nothing wrong
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
SAP UI5 应用开发教程之一百零四 - SAP UI5 表格控件的支持复选(Multi-Select)以及如何用代码一次选中多个表格行项目
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条
随机推荐
mixconv代码
Genicam gentl standard ver1.5 (4) Chapter 5 acquisition engine
今日睡眠质量记录71分
MySQL5.7 设置密码策略(等保三级密码改造)
Cutefishos system~
[JUC learning road day 9] barrier derivatives
Efficiency improvement - encourage personalized container development environment
[daily training] 326 Power of 3
倒置残差的理解
Turn -- the underlying debugging principle of GDB is so simple
Happy number [fast and slow pointer of ring PROBLEMS]
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
Fiori 应用通过 Adaptation Project 的增强方式分享
【无标题】
业务可视化-让你的流程图'Run'起来
Use and function of spark analyze command map join broadcast join
Talk about what parameters ZABBIX monitors
Hide the creation and use of users
Using emqx cloud to realize one machine one secret verification of IOT devices
Electron学习(三)之简单交互操作