Markdown UML 时序图

Markdown UML 时序图(Sequence Diagram)

  • 时序图标签
  • 时序图标题
  • 时序图角色
  • 时序图连线
  • 时序图注释

时序图标签

```sequence    //时序图开始标签

```            //时序图结束标签 

时序图标题

title:标题内容

时序图角色

participant ActorA        //设置ActorA
participant ActorB as B   //设置B为ActorB的别称

时序图连线

ActorA->ActorB : 消息名称
ActorA-->ActorB : 消息名称
ActorA->>ActorB : 消息名称
ActorA-->>ActorB : 消息名称

-代表实线
--代表虚线
>代表实心箭头
>>代表虚心箭头

注意:
1. Actor与连线箭头之间不要有空格
2. 冒号前面不要有空格

时序图注释

note left of actor: 注释内容         //actor是通过participant定义的
note right of actor: 注释内容        //actor是通过participant定义的
note over actor: 注释内容            //actor是通过participant定义的
note over actorA, actorB: 注释内容   //actorA, actorB是通过participant定义的

注意: 冒号前面不要有空格

例子

```sequence
title : Example of Sequence Diagram

participant ActorA
participant Actor B
participant ActorC as C
participant Actor D as D

ActorA->Actor B: line1
Actor B-->C: line2
C->>D: line3
D->>ActorA: line4


note left of ActorA: note left of ActorA
note right of Actor B: note left of Actor B
note over C:note over ActorC
note over C, D: note over ActorC and Actor D
```  
Created with Raphaël 2.1.2 Example of Sequence Diagram ActorA ActorA Actor B Actor B ActorC ActorC Actor D Actor D line1 line2 line3 line4 note left of ActorA note left of Actor B note over ActorC note over ActorC and Actor D

猜你喜欢

转载自blog.csdn.net/red98/article/details/80313379