我正在教授一门使用 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?
发布评论
评论(1)
总的来说,请注意序列图没有精确的语义(据我所知,它们不包含在新的基本 UML 语义),因此它们或多或少“可以解释”,以满足您特定的草图绘制需求。
一般来说,序列图是什么意思?它是一个通用规范(“这就是系统始终的行为方式”,因此没有其他允许的行为)?或者它是一个存在的规范(“这是系统应该支持的场景”,因此不支持的系统是不正确的)?或者它仅仅是一个描述(“这可能会发生”)。没有答案,因为 SD 没有这样的精确语义。
(当然,一些形式化确实存在,但这取决于你想教什么。)
因此,我不认为这问题有一个独特的答案:
也就是说:
根据本教程,执行发生(EO)表示:
另请参阅下一个关于自我消息传递的图表,其中嵌套了执行发生。
此外,此处简单地说,EO 是:
最后,EO 参考执行规范 代表:
我希望它有帮助:)
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:
That said:
According to this tutorial, execution occurence (EO) denotes:
Look also at the next diargam, about self-messaging, where you have nested execution occurences.
Moreover, here it is simply said that EOs are:
Finally, EOs reference execution specifications which represent:
I hope it helps :)