UML:流程和活动图 [英] UML : Process and Activity diagram
问题描述
我可以在流程/活动 UML 图中使用双向箭头吗?有什么例子吗?我正在准备一个带有泳道的流程图.我遇到了许多进程在泳道中交叉引用的情况.不是一个好的原样设计.只是想知道用双向箭头来表示这样的流程图可以吗?有什么缺点?
Can I use bidirectional arrows in Process/Activity UML diagram? Any example? I am preparing a process diagram with swimlanes. what I encountered that many processes are cross referencing across the swim lanes. Not a good as-is design. Just want to know is it ok to use bidirectional arrows to represent such process diagram? What are the disadvantages?
推荐答案
UML 规范在这里很难消化.活动/动作与 ControlFlow
相关(参见规范的第 418 页).ControlFlow
本身就是一个 ActivityEdge
(参见第 411 页):
The UML specs is hard to digest here. Activities/actions are connected with ControlFlow
s (see p. 418 of the specs). A ControlFlow
itself is an ActivityEdge
(see p. 411):
ActivityEdge 是一个抽象类,用于两个 ActivityNode 之间的定向连接.
An ActivityEdge is an abstract class for directed connections between two ActivityNodes.
没有任何限制(我能找到)禁止双向使用.不过,ControlFlow
的所有示例都只是用单箭头指向的.
There is no constraint (I could find) that forbids bi-directional use. All examples of ControlFlow
s are just directed with single arrow, though.
使用双向流不会让您轻松指定守卫/行为,因为您无法检测哪个方向.但如果你有无条件的流动,那应该没问题.
Using bi-directional flows will not let you specify guards/behavior easily as you can not detect which is for which direction. But if you have unconditional flow it should just be fine.
编辑在页码.22 说明
DirectedRelationship 表示源模型元素集合和目标模型元素集合之间的关系.据说 DirectedRelationship 从源元素指向目标元素.
A DirectedRelationship represents a Relationship between a collection of source model elements and a collection of target model elements. A DirectedRelationship is said to be directed from the source elements to the target elements.
DirectedRelationship
继承自 Relationship
,后者继承自 Element
.ActivityEdge
相比之下,继承自 RedefinableElement
<- NamedElement
<- Element
.可能他们意味着"ControlFlow
必须从源定向到目标.但实际上并没有定义.
DirectedRelationship
inherits from Relationship
which inherits from Element
. ActivityEdge
in contrast inherits from RedefinableElement
<- NamedElement
<- Element
. Likely they "mean" that ControlFlow
has to be directed from source to target. But in fact it's not defined.
tl;dr 如果您只使用规范中示例中所示的单向连接器,这取决于您.但是根据定义,它没有定义(原文如此!)并且双向连接器不违反规范.
tl;dr It's up to you if you use only uni-directional connectors as shown in examples in the spec. But per definition it's not defined (sic!) and bi-directional connectors do not violate the specs.
这篇关于UML:流程和活动图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!