序列图中执行发生的语义

发布于 2024-12-18 06:23:00 字数 228 浏览 1 评论 0 原文

我正在教授一门使用 UML 作为系统建模工具的课程。在课程中,我们教授序列图,在准备课程时,我发现“执行发生”的语义没有明确的定义。 例如。如果对象进行自我调用“等待输入”并且此调用位于执行事件内,则该对象可以接收消息吗?显然我认为是的,因为它正在等待消息。

但这反驳了执行发生意味着对象当前“忙”或“活动”的想法。

有什么帮助/想法吗?我的结论是离开这个话题并告诉学生们不要理会执行事件。还有更好的想法吗?

I am teaching a course that uses UML as the tool to model systems. In the course we teach sequence diagrams and while preparing the course I found that there is no clear definition of the semantics of an "execution occurrence".
For example. If an object makes a self call "wait for input" and this call is inside an execution occurrence, can the object receive messages? Obviously I think yes, because it is waiting for messages.

But this counters the idea that execution occurrences mean that the object is currently "busy" or "active".

Any help/ideas? My conclusion was to leave the subject and tell the students to disregard execution occurrences. Any better ideas?

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

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

发布评论

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

评论(1

困倦 2024-12-25 06:23:00

总的来说,请注意序列图没有精确的语义(据我所知,它们不包含在新的基本 UML 语义),因此它们或多或少“可以解释”,以满足您特定的草图绘制需求。

一般来说,序列图是什么意思?它是一个通用规范(“这就是系统始终的行为方式”,因此没有其他允许的行为)?或者它是一个存在的规范(“这是系统应该支持的场景”,因此不支持的系统是不正确的)?或者它仅仅是一个描述(“这可能会发生”)。没有答案,因为 SD 没有这样的精确语义。

(当然,一些形式化确实存在,但这取决于你想教什么。)

因此,我不认为这问题有一个独特的答案:

“如果一个对象进行自我调用“等待输入”并且此调用位于执行事件内,则该对象可以接收消息吗?”

也就是说:

根据本教程,执行发生(EO)表示:

执行发生,或控制焦点的激活

另请参阅下一个关于自我消息传递的图表,其中嵌套了执行发生。

此外,此处简单地说,EO 是:

动作或行为开始或结束的时刻

最后,EO 参考执行规范 代表:

参与者一生中的一段时期,此时它(a)在生命线内执行一个行为或动作单元,(b)向另一个参与者发送信号或(c)等待另一个参与者的回复消息。

我希望它有帮助:)

Overall, note that Sequence Diagrams don't have precise semantics (and AFAIK, they're not included in the new base UML semantics) so therefore they're more or less "open to interpretation", to suit your specific sketching needs.

In general, what does a Sequence Diagram mean? Is it a universal specification ("this is how the system will always behave" therefore there are no other allowable behaviors)? Or is it an existential specification ("this is a scenario which the system should support" therefore a system that doesn't is incorrect)? Or is it merely a description ("this might happen"). There is no answer, because SDs don't have precise semantics like that.

(Granted, some formalizations do exist, but then it depends what you want to teach.)

Therefore, I don't think that this quesiton has a unique answer:

"If an object makes a self call "wait for input" and this call is inside an execution occurrence, can the object receive messages?"

That said:

According to this tutorial, execution occurence (EO) denotes:

the execution occurrence, or activation of a focus of control

Look also at the next diargam, about self-messaging, where you have nested execution occurences.

Moreover, here it is simply said that EOs are:

moments in time at which actions or behaviors start or finish

Finally, EOs reference execution specifications which represent:

a period in the participant's lifetime when it is (a) executing a unit of behavior or action within the lifeline, (b) sending a signal to another participant or (c) waiting for a reply message from another participant.

I hope it helps :)

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