当前位置:网站首页>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
边栏推荐
- ECMAScript 2022 was officially released. Have you heard about it?
- MySQL -- index of MyISAM storage engine
- Turn -- bring it and use it: share a gadget for checking memory leaks
- Origin2018安装教程「建议收藏」
- 转--深入LUA脚本语言,让你彻底明白调试原理
- Reprint CSDN article operation
- SAP GUI 里的收藏夹事务码管理工具
- MySQL stored procedure
- twenty million two hundred and twenty thousand seven hundred and one
- Selection of all-optical technology in the park - Part 2
猜你喜欢
![Happy number [fast and slow pointer of ring PROBLEMS]](/img/37/5c94b9b062a54067a50918f94e61ea.png)
Happy number [fast and slow pointer of ring PROBLEMS]

el-input文本域字数限制,超过显示变红并禁止输入

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

转载csdn文章操作

Multi picture alert ~ comparison of Huawei ECs and Alibaba cloud ECS

思科考试--路由的概念和配置考试
![[JUC learning road day 9] barrier derivatives](/img/7d/25a49afa470cfef5b7b383918d6a7d.png)
[JUC learning road day 9] barrier derivatives

Flynk SQL client uses comparison and is familiar with official documents

Fiori applications are shared through the enhancement of adaptation project

ESP自动下载电路设计
随机推荐
元宇宙可能成为互联网发展的新方向
Preparation of functional test report
[literacy] deep / shallow, local / global features in machine learning image processing
[C language] detailed explanation of malloc function [easy to understand]
ECMAScript 2022 was officially released. Have you heard about it?
Niuke monthly race - logarithmic sum in groups
Mixconv code
Appium automated testing foundation - Supplement: introduction to desired capabilities parameters
Understanding of transactions in MySQL
Appium自动化测试基础 — 补充:Desired Capabilities参数介绍
SAP ui5 application development tutorial 104 - multi select support for SAP ui5 table controls and how to use code to select multiple table row items at a time
Configure filter
正则系列之量词(Quantifiers)
Measurement of reference loop gain and phase margin
Favorite transaction code management tool in SAP GUI
使用3DMax制作一个象棋棋子
Using securecrtportable to remotely connect virtual machines
El input text field word limit, beyond which the display turns red and input is prohibited
Appium automation test foundation - appium installation (I)
转--原来gdb的底层调试原理这么简单