Chapter 5. Interaction Diagrams

Chapter 5. Interaction Diagrams

Interaction diagrams are models that describe how groups of objects collaborate in some behavior.

Typically, an interaction diagram captures the behavior of a single use case. The diagram shows a number of example objects and the messages that are passed between these objects within the use case.

I'll illustrate the approach with a simple use case that exhibits the following behavior.

  • The Order Entry window sends a "prepare" message to an Order.

  • The Order then sends "prepare" to each Order Line on the Order.

  • Each Order Line checks the given Stock Item.

    • If this check returns "true," the Order Line removes the appropriate quantity of Stock Item from stock and creates a delivery item.

    • If the Stock Item has fallen below the reorder level, that Stock Item requests a reorder.

There are two kinds of interaction diagrams: sequence diagrams and collaboration diagrams.