How to represent a call being made in a loop in a sequence diagram?

Adam Taylor picture Adam Taylor · Feb 8, 2009 · Viewed 93.2k times · Source

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?

Answer

joel.neely picture joel.neely · Feb 8, 2009

A box enclosing the message send arrow (and whatever else is inside the same repetitive construct).

See this tutorial for an example.

sequence diagram with loop link to larger image (archived)