没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Drawing UML with PlantUML
Language Reference Guide
(Version 2017.08)
PlantUML is an Open Source project that allows to quickly write:
• Sequence diagram,
• Usecase diagram,
• Class diagram,
• Activity diagram,
• Component diagram,
• State diagram,
• Object diagram.
Diagrams are defined using a simple and intuitive language.
1 SEQUENCE DIAGRAM
1 Sequence Diagram
1.1 Basic examples
The sequence -> is used to draw a message between two participants. Participants do not have to be
explicitly declared.
To have a dotted arrow, you use -->
It is also possible to use <- and <--. That does not change the drawing, but may improve readability.
Note that this is only true for sequence diagrams, rules are different for the other diagrams.
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
1.2 Declaring participant
It is possible to change participant order using the participant keyword.
It is also possible to use other keywords to declare a participant:
• actor
• boundary
• control
• entity
• database
@startuml
actor Foo1
boundary Foo2
control Foo3
entity Foo4
database Foo5
Foo1 -> Foo2 : To boundary
Foo1 -> Foo3 : To control
Foo1 -> Foo4 : To entity
Foo1 -> Foo5 : To database
@enduml
PlantUML Language Reference Guide (Version 2017.08) 1 of 127
1.3 Use non-letters in participants 1 SEQUENCE DIAGRAM
You can rename a participant using the as keyword.
You can also change the background color of actor or participant.
@startuml
actor Bob #red
' The only difference between actor
'and participant is the drawing
participant Alice
participant "I have a really\nlong name" as L #99 FF99
/' You can also declare:
participant L as "I have a really \nlong name" #99FF99
'/
Alice -> Bob: Authentication Request
Bob ->Alice: Authentication Response
Bob ->L: Log transaction
@enduml
1.3 Use non-letters in participants
You can use quotes to define participants. And you can use the as keyword to give an alias to those
participants.
@startuml
Alice -> "Bob()" : Hello
"Bob ()" -> "This is very\nlong " as Long
' You can also declare :
' "Bob ()" -> Long as "This is very\nlong "
Long --> "Bob()" : ok
@enduml
PlantUML Language Reference Guide (Version 2017.08) 2 of 127
1.4 Message to Self 1 SEQUENCE DIAGRAM
1.4 Message to Self
A participant can send a message to itself.
It is also possible to have multi-line using \n.
@startuml
Alice -> Alice: This is a signal to self .\ nIt also demonstrates \ nmultiline \ntext
@enduml
1.5 Change arrow style
You can change arrow style by several ways:
• add a final x to denote a lost message
• use \ or / instead of < or > to have only the bottom or top part of the arrow
• repeat the arrow head (for example, >> or //) head to have a thin drawing
• use -- instead of - to have a dotted arrow
• add a final ”o” at arrow head
• use bidirectional arrow
@startuml
Bob ->x Alice
Bob -> Alice
Bob ->> Alice
Bob -\ Alice
Bob \\- Alice
Bob //-- Alice
Bob ->o Alice
Bob o\\-- Alice
Bob <-> Alice
Bob <->o Alice
@enduml
PlantUML Language Reference Guide (Version 2017.08) 3 of 127
1.6 Change arrow color 1 SEQUENCE DIAGRAM
1.6 Change arrow color
You can change the color of individual arrows using the following notation:
@startuml
Bob -[# red]> Alice : hello
Alice -[#0000FF]->Bob : ok
@enduml
1.7 Message sequence numbering
The keyword autonumber is used to automatically add number to messages.
@startuml
autonumber
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response
@enduml
You can specify a startnumber with autonumber 'start' , and also an increment with autonumber
'start' 'increment'.
@startuml
autonumber
Bob -> Alice : Authentication Request
Bob <- Alice : Authentication Response
autonumber 15
Bob -> Alice : Another authentication Request
Bob <- Alice : Another authentication Response
autonumber 40 10
PlantUML Language Reference Guide (Version 2017.08) 4 of 127
剩余127页未读,继续阅读
资源评论
CrazyL-
- 粉丝: 105
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- docker一键安装包
- Screenshot_20240430_144340_com.ss.android.ugc.live.jpg
- 回到山沟沟.mp3
- 基于matlab实现自适应波束形成RLS及LMS算法仿真源程序1.rar
- 基于matlab实现自己编写的基于卡尔曼滤波的利用加速度传感器的计步器,测试数据是传感器放在腰部和手臂 .rar
- 基于matlab实现阵列信号处理,波束形成.rar
- 111111111111111111
- 基于matlab实现计步器编程;对当前的计步器装置的数值算法模拟 .rar
- Mdb学习查看PW;access;mdb;pw;password;patch
- 基于matlab实现关于语音信号声源定位DOA估计所用的一些传统算法.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功