An example of an object interaction diagram is shown below. This diagram involves three objects (aCanvas, aShape, and aLocation). Time flows from the top of the diagram to the bottom of the diagram. Invocations are drawn as horizontal arrows labelled by the name of the method being invoked. An object is ddrawn as a thin vertical line during periods when it is not processing an invocation. An object is drawn as a rectangle during periods when it is processing an invocation.
The diagram shows the scenario (the sequence of invocations) that occurs when a Canvas object is asked to perform its "Scroll" method. In this diagram, the aCanvas object receives the Scroll method invocation to initiate the sequence. The aCanvas object uses the MoveTo method to reposition the aShape object at its new viewing position. In this example the aShape object is assumed to be an object in the Rectangle class. To reposition itself, aShape calls its own Erase (from its current location) and Draw (at its new location) methods. In between erasing and drawing, aShape changes its location by using the Change method in the aLocation object. Finally, to perform the erasing and drawing, the aShape object "calls back" to the aCanvas object, using the EraseLine and DrawLine methods of the Canvas class.
Last Updated: December 6, 1995 / kafura@cs.vt.edu