UML 序列图 消息分支

标签 uml sequence

有人在序列图中使用过消息分支吗?有谁知道这个具体是做什么用的吗?

据我所知,它用于显示多个收件人收到的单个消息

Diagram showing a message branching to two recipients

我刚刚看到它用于显示并发性,但我认为这是不正确的,应该由“par”片段或在共同区域内进行描述。

diagram showing a message branching to one recipient

想法和意见?

最佳答案

UML 2+

据我所知,UML 2+ 中的序列图中不存在消息分支这样的东西(但请参阅结尾)。

首先,Message 是一对 sendEventreceiveEvent,其中 sendEvent (对于foundMessage)和receiveEvent(对于lostMessage)可以是可选的,但它不能有多个发送者/接收者。

enter image description here

如果有的话,您的图表将是两个不同的消息发送,因为如果您有两个接收者,那么每个接收者都会呈现不同的 receiveEvent (因此是唯一的 Message) .

此外,您使用的符号很奇怪,因为[强调我的]

In an interaction diagram each vertical line describes the time-line for a process, where time increases down the page. The distance between two events on a time-line does not represent any literal measurement of time, only that non-zero time has passed.

因此非水平线意味着非零时间间隔,并且规范没有提及此类弯曲线。

UML 1.3 (<2)

我在 UML 1.3 中发现了消息分支 ( http://doc.omg.org/formal/2000-03-01.pdf )

Variation: Branching

A branch is shown by multiple arrows leaving a single point, each labeled by a guard condition. Depending on whether the guard conditions are mutually exclusive, the construct may represent conditionality or concurrency.

但是 UML 1.3 没有明确定义的元模型。

摘要

据我所知,从 UML 2 开始,消息分支已从规范中删除。但是,它可以由两个具有明确定义的 Ordering 的单独消息来表示,或者使用 par 片段,如果它是并行的(这不是同一件事)。

关于UML 序列图 消息分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36060968/

相关文章:

events - 如何在静态 UML 模型中表示基于事件的架构?

Java - 确定事件顺序 - AB 或 BA

python - 使用唯一元素创建所有可能的子序列

r - 如何在 R 中提取与正则表达式 (regexpr) 索引相关的文本

kotlin - Kotlin序列中的短路操作

UML - 关联或聚合关系?

java - 类图中的聚合关系?

uml - 状态机与事件

uml - 在开发过程中使用 UML 图的一般/典型顺序是什么?

vector - 通过字符串输入时的 Clojure boolean 混淆