英文:
Is the UML sequence diagram with two activations instead of one correct?
问题
以下序列图由Sparx Enterprise Architect渲染。新激活(蓝色)的开始是否正确?它不应该继续在Object2上的现有激活上吗?
请注意,流程是以异步(红色)调用开始的。
如果图表是正确的,为什么在下面的情况中(几乎相同),新的激活没有启动?
英文:
The following sequence diagram is rendered by Sparx Enterprise Architect. Is the start of the new activation (blue) correct? Shouldn't it rather continue with the existing activation on the Object2?
Please note that the flow starts with the asynchronous (red) call.
If the diagram is correct, why the new activation is not started in the following (almost identical) case?
答案1
得分: 2
UML leaves you full flexibility about the execution specifications. So it is indeed a choice whether the blue message is in a separate activation or within the same activation.
UML让您在执行规范方面具有完全的灵活性。因此,将蓝色消息放在单独的激活中还是在同一个激活中,确实是一个选择。
EA makes tries to make an educated guess. It is not clear to me why in the second case it continues and in the first not, but it may be related to some heuristics.
EA试图做出合理的猜测。我不清楚为什么在第二种情况下它继续,而在第一种情况下不继续,但这可能与某些启发式方法有关。
Regardless of what EA proposes, you can however override it, by right clicking on the relevant message to get the contextual menu. You may then chose Extend Source Activation Down
to make the previous activation continue.
无论EA提出什么建议,您都可以通过右键单击相关消息以获得上下文菜单来覆盖它。然后,您可以选择Extend Source Activation Down
来使前一个激活继续。
英文:
UML leaves you full flexibility about the execution specifications. So it is indeed a choice whether the blue message is in a separate activation or within the same activation.
EA makes tries to make an educated guess. It is not clear to me why in the second case it continues and in the first not, but it may be related to some heuristics.
Regardless of what EA proposes, you can however override it, by right clicking on the relevant message to get the contextual menu. You may then chose Extend Source Activation Down
to make the previous activation continue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论