没有合适的资源?快使用搜索试试~ 我知道了~
首页PlantUML-Language-Reference-Guide
资源详情
资源评论
资源推荐
Drawing UML with PlantUML
Language Reference Guide
(Version 8008)
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.
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
1.2 Comments
Everything that starts with simple quote ' is a comment.
You can also put comments on several lines using /' to start and '/ to end.
1.3 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 8008) 1 of 120
1.4 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 #99FF99
/' 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.4 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 8008) 2 of 120
1.5 Message to Self 1 SEQUENCE DIAGRAM
1.5 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.6 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 8008) 3 of 120
1.7 Change arrow color 1 SEQUENCE DIAGRAM
1.7 Change arrow color
You can change the color of individual arrows using the following notation:
@startuml
Bob -[# red]> Alice : hello
Alice -[#0000 FF]->Bob : ok
@enduml
1.8 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 8008) 4 of 120
剩余120页未读,继续阅读
vitaldye
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2