0.5.10 Modeling a Web Request With a Sequence Diagram

Model a Soccer Web Request with a Sequence Diagram

A supporter opens the Wildcats fixtures page. The browser requests information, the server handles that request, and the browser uses the response to display the page. A sequence diagram makes those exchanges and responsibilities explicit.

This page retains its existing filename. Its curriculum topic is a web request modeled with a sequence diagram; use participant lifelines and messages here, rather than activity partitions.

Choose One Request and Its Participants

Model one conceptual request for the fixtures page. The browser is the client and the server receives the request. This simplified view omits DNS, connection setup, caching, and the separate requests a real page may need for images or scripts.

The following message labels describe the exchange; they are not C# method declarations.

Supporter opens fixtures. Browser requests it from the server, receives a success or failure response, and displays the corresponding result.
The browser waits for a server response
  • New
  • Changed
  • Removed
Follow One Exchange

The request arrow starts at the browser and targets the server. The response reverses direction. The server does not draw directly on the supporter's screen; the browser interprets the response and displays a result.

The alternative frame separates two possible responses to the same request. During one execution, choose one route. A failure response is still a response; it is different from a connection that never returns any response.

Draw the Interaction
  1. Place the supporter, browser, and server participants.
  2. Draw the request before the response, with the arrow aimed at the receiving participant.
  3. Add response alternatives only if they matter to the question being modeled.
  4. Finish with the browser displaying the result; do not invent a database participant without evidence that it is used.