如何在序列图中表示在循环中进行的调用? [英] How to represent a call being made in a loop in a sequence diagram?

查看:35
本文介绍了如何在序列图中表示在循环中进行的调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个序列图,其中一个类正在被另一个类观察.被观察的类在循环中每 5 秒调用一次观察者中的更新.我需要在序列图中显示这一点.有没有办法显示它按原样无限循环?

或者在序列图的上下文中没有意义;我不应该包括它吗?或者我应该将它包含在不同类型的图表中?

解决方案

您可以使用包含消息发送箭头的框(以及同一重复结构中的其他任何内容).

请参阅 (存档)

I'm creating a sequence diagram, and one of the classes is being observed by another class. The observed class is calling update in the observer every 5 seconds in a loop. I need to show this in the sequence diagram. Is there a way to show it looping indefinitely out of sequence as it were?

Or does it not make sense in the context of a sequence diagram; should I not include it? Or should I include it in a different type of diagram?

解决方案

You can use a box enclosing the message send arrow (and whatever else is inside the same repetitive construct).

See this tutorial for an example.

link to larger image (archived)

这篇关于如何在序列图中表示在循环中进行的调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆