You already know that a sequence diagram can show a method call:
caller → team1 : GetScore()When a method returns a value, the diagram can also show information traveling back toward the caller.
This makes the full interaction visible:
caller
↓ method call
team1
↑ returned value
callerSuppose the caller asks:
GetScore()of team1.
Conceptually:
caller ── GetScore() ──> team1
caller <── score: 3 ─── team1The first message goes to the object whose method executes.
The returned value goes back to the caller.
For CO-043, the purpose of the diagram is specifically to show returned values.
A return message can communicate that:
GetScore()produced an integer such as:
3The method call alone would not show what information came back.
A class diagram might show:
GetScore() : intThat describes the method generally.
A sequence diagram shows a specific interaction:
controller1 → team1 : GetScore()
team1 → controller1 : 3The class diagram answers:
The sequence diagram answers:
If the class diagram says:
GetScore() : intthen a return message showing:
3makes sense because 3 is an integer.
A return message containing unrelated text would not match the current method contract.
The UML views should agree.
A conceptual sequence interaction:
controller1 → team1 : GetScore()
team1 → controller1 : 3can correspond to C# such as:
int currentScore = team1.GetScore();The relationship is:
sequence call
↓
C# method invocation
↓
method returns int
↓
sequence return message
↓
local variable receives resultIn C#:
int currentScore = team1.GetScore();the local variable is:
currentScoreA sequence diagram is primarily concerned with the interaction between participants.
It may show the returned information clearly without reproducing every local-variable detail from the source.
The exact diagram should communicate the return meaning required by the current task.
For this call:
controller1 → team1 : GetScore()team1 is the receiver.
The returned value travels from:
team1back toward:
controller1If the return arrow goes in the same direction as the original call, the interaction is being modeled incorrectly.
The return message communicates the result of the original method execution.
It is not another call such as:
ReturnScore()unless the program actually defines and calls a method with that name.
Do not invent a method merely to represent the return.
The sequence order is:
GetScore() call
↓
GetScore executes
↓
value is produced
↓
value returns to callerThe return cannot appear before the call that produced it.
Vertical ordering in the sequence diagram should preserve that logic.
CO-043 uses simple return flows.
Do not introduce:
Those ideas belong to later Learning Activities.
A complete explanation might be:
If the diagram supports that sentence, it is communicating both the method call and the returned value clearly.
Keep the three views aligned:
Class diagram:
GetScore() : int
Sequence diagram:
caller → team1 : GetScore()
team1 → caller : 3
C#:
int currentScore = team1.GetScore();Together they show: