UML 序列图消息分支 [英] UML Sequence Diagram Message Branching

查看:78
本文介绍了UML 序列图消息分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Has anyone used message branching in sequence diagrams? Does anyone know what this is specifically used for?

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

To the best of my understanding it is used to show a single message being received by multiple recipients

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

I have just seen it used to show concurrency, but I think that is incorrect and should be described by a "par" fragment or inside a co-region.

想法和意见?

推荐答案

UML 2+

据我所知,UML 2+ 中的序列图中没有消息分支之类的东西(但请参阅结尾).

UML 2+

As far as I know there's no such thing as message branching in sequence diagrams in UML 2+ (but see the end).

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

To begin with, a Message is a pair of sendEvent and receiveEvent, where both the sendEvent (for foundMessage) and receiveEvent (for lostMessage) can be optional, but it cannot have multiple senders/receivers.

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

If anything, your diagram would be two different message sends, because if you have two receivers, then each one presents a different receiveEvent (and therefore a unique Message).

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

Furthermore the notation you've used is odd, because [emphasis mine]

在交互图中,每条垂直线都描述了一个过程的时间线,时间在页面下方增加.时间线上两个事件之间的距离并不代表任何字面上的时间测量,仅表示非零时间已经过去.

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.

所以非水平线意味着非零时间间隔,并且规范没有提到这种弯曲线.

so the non-horizontal line means non-zero time interval, and the spec doesn't make a mention of such bent lines.

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

I've found message branching in UML 1.3 (http://doc.omg.org/formal/2000-03-01.pdf)

变化:分支

一个分支由离开一个点的多个箭头表示,每个箭头都用一个标记守卫条件.取决于保护条件是否相互排他性,构造可以表示条件或并发.

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 没有定义明确的元模型.

However UML 1.3 doesn't have a well-defined metamodel.

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

As far as I can tell, message branching was dropped from the specifications starting from UML 2. It can however be represented by two separate messages with well-defined Ordering, or by using par fragment if it is parallel (which is not the same thing).

这篇关于UML 序列图消息分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆