为什么这个星级UML序列图没有激活“矩形”在控制对象中?

发布于 2025-01-29 19:09:04 字数 247 浏览 3 评论 0 原文

为什么此星级UML序列图在控制对象中没有激活“矩形”?我做错了吗?我应该在星级uml中设置一些东西吗?

如何在控制对象中添加激活“矩形”?

Why DOESN'T this Star UML Sequence Diagram have the activation "rectangle" in the Control object? Am I doing something wrong? Should I set something in Star UML?

enter image description here

How can I add the activation "rectangle" in the Control object?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

遇见了你 2025-02-05 19:09:04

简单的答案是:因为这就是Star UML的设计师设计的。

在Star UML中,如果没有任何启动(触发器)执行的发生(这是该矩形的正式名称),那么……没有执行。如果您想拥有它,则需要以某种方式触发它(例如,通过自我引用启动消息)。

我没有找到任何改变这种行为的选择。我已经有一段时间没有使用Star UML了,但是由于免费版本已经比我开始使用的版本更早地放弃了,所以我相信此后什么都没有改变。

如果您使用的是较新的专有版本,则可以向Star UML的开发团队发送请求,以将其添加为功能。

The simple answer is: because that's how the designers of Star UML designed it to be.

In Star UML if nothing initiates (triggers) the Execution Occurrence (that's the formal name of that rectangle) then... there is no Execution Occurrence. If you want to have it, you need to trigger it somehow (e.g. by self-referencing Initiation message).

I didn't find any option to change that behaviour. I haven't been using the Star UML for quite some time but since the free version has been abandoned earlier than I've started using it, I believe nothing has changed since.

If you're using the newer, proprietary version, you can send a request to the dev team of Star UML to add it as a functionality.

非要怀念 2025-02-05 19:09:04

好吧,这是因为工具我知道正确实现的序列图。根据UML,应该可以定义独立于任何消息的Executions Percifications(又称激活)。

但是,许多工具供应商似乎假设必须通过消息启动执行规范。我可以看到它们来自哪里,因为每个执行都有原因。问题在于序列图与因果关系无关,而与可能发生的事件序列有关。序列图并不意味着这是唯一可能的序列。

如果我们接受该工具想要使用消息启动执行规范,则Star UML的行为是一致的。请注意,创建消息(IE Messageort = createMessage)确实 调用构造函数:

uml:创建对象是创建一个直接实例的动作
给定的分类器并将新实例放在其结果输出上。
该动作没有其他影响。特别是没有行为
执行

,这是关于操作的,但是为什么创建消息应该与众不同?此外,还有一个约束,可以阻止创建消息具有签名:

signature_refer_to

签名必须引用操作(在这种情况下是MessageSort是同步或异步或回复)或信号(在这种情况下,MessageSort为asynchsignal)。

这意味着,您不能在创建消息中引用构造函数。您需要明确调用构造函数。此消息的发件人与创建新对象的生命线相同。它不应该是一个自我信息,因为这不是现实中发生的事情,因此是解决方法。

还有另一个选择。您可以使课程成为活动课程。

一个活动对象是一个对象,它是其创建的直接结果,开始执行其分类器

许多工具显示了执行规范,涵盖了活动类的整个生命线。也许您的班级本来应该活跃?

PS:当然,这不是完全正确的,因为分类器行为也需要明确启动:

startObjectBehaviorAction是一种呼叫,启动了对象的分类器的执行[…]

,该对象表示不会自动启动。我们需要一个ActionExecutions Pecifitific来启动它。很少有工具支持这一点:-(

Well, this is because no tool I know of implemented sequence diagrams correctly. According to UML it should be possible to define ExecutionSpecifications (aka activations) independent of any Messages.

However, many tool vendors seem to assume, that an ExecutionSpecification must be started by a message. I can see, where they come from, since every execution has a cause. The problem is that sequence diagrams are not about causality, but about possibly occurring sequences of events. Sequence diagrams don’t mean, that this is the only possible sequence.

If we accept that the tool wants to start an ExecutionSpecification with a Message, the behavior of Star UML is consistent. Please note that a create message (i.e. messageSort=createMessage) does not call the constructor:

UML: A CreateObjectAction is an Action that creates a direct instance of a
given Classifier and places the new instance on its result OutputPin.
The Action has no other effect. In particular, no Behaviors are
executed

I know, this is about Actions, but why should a create message be different? Also, there is a constraint that stops create messages from having a signature:

signature_refer_to

The signature must either refer an Operation (in which case messageSort is either synchCall or asynchCall or reply) or a Signal (in which case messageSort is asynchSignal).

That means, you cannot reference a constructor in the create message. You will need to call the constructor explicitly. The sender of this message is the same Lifeline that created the new object. It should not be a self message, since this is not what is happening in reality and is therefore a workaround.

There is another option. You can make the class an active class.

An active object is an object that, as a direct consequence of its creation, commences to execute its classifierBehavior

Many tools show an ExecutionSpecification covering the whole lifeline for an active Class. Maybe your Class is meant to be active?

PS: Of course, this is not completely correct, since the classifier behavior also needs to be started explicitly:

A StartObjectBehaviorAction is a CallAction that starts the execution […] of the classifierBehavior of an object

That means, it doesn’t start automatically. We need an ActionExecutionSpecification to start it. Very few tools support this :-(

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文