ITPEC FE Morning October 2020 Question 45
Which of the following UML diagrams shows the exchange of messages among objects, message transmission, and object lifelines in a time series?
Explanation
Sequence diagram — it lays out the messages between objects in the order they happen in time.
Each object taking part in the interaction gets a vertical lifeline, and time runs from top to bottom. Messages are horizontal arrows from one lifeline to another, so reading downwards gives the exact order of calls and replies. It is the UML diagram to use when a question stresses messages, lifelines and a time series together.
Answer (c)
Why not others:
- •(a) Activity diagram — shows the flow of control from one action to the next, like a flowchart, with no lifelines or messages between objects
- •(b) Communication diagram — shows the same messages between objects, but places the objects by their links and orders the messages with sequence numbers; it has no time axis and no lifelines
- •(d) State-machine diagram — follows the states of a single object and the events that move it between them, not the interaction among several objects
Key rule: Among the UML interaction diagrams, a sequence diagram emphasises time order and a communication diagram emphasises the links between objects.
System Development Technology · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.