1.7.7 Object Parameters in Sequence Diagrams

A Message Shows Who Receives the Call

A sequence diagram's call arrow points to the object receiving a method call. An object reference passed as an argument appears in the message label.

Controller calls Game with a Player argument.
Object reference in a sequence diagram
  • New
  • Changed
  • Removed
An Argument Is Not the Receiver

Consider a Controller calling a Game method:

game1.RecordTurn(player1);

The call arrow goes from `controller1 : Controller` to `game1 : Game`. It is labeled `RecordTurn(player1)`. The label identifies `player1 : Player` as the argument.

Game calls TakeTurn on the Player after Controller calls Game.
A second interaction
  • New
  • Changed
  • Removed
The Parameter Gets a Path to the Player

Inside Game's method, the Player parameter receives a copy of the reference supplied by `player1`. The method can therefore access that Player without the call arrow pointing to the Player.

An Additional Call Needs Another Message

If Game subsequently calls `participant.TakeTurn()`, the diagram has another message from Game to Player, placed later on the timeline. A field assignment such as `participant.NumberOfTurns++` is not itself a method call message.

Order Shows When the Player Is Used

The controller's message reaches Game first. Any later call Game makes on Player happens while Game's method is running. That vertical order explains the interaction more clearly than the argument label alone.