Question 1
Choose the correct answer:
Consider the following diagram:
OMG-OCUP2-FOUND100 Question 4
Which statement is always true in the diagram?
- AOption A:
Receiving m{C) must come before sending m(D).
- BOption B:
Sending m(D) is the first occurrence of this scenario.
- COption C:
Receiving m{D) is the last occurrence of this scenario.
- DOption D:
All occurrences of v[11 will happen before all occurrences of v[3]
Show answer and explanation
Correct answer: A
The diagram shows a UML Sequence Diagram where two messages are being exchanged between lifelines representing instances of
objects: m(C) is being sent from v1 to v2 , and m(D) is being sent back from v2 to v1 .
In a sequence diagram, the vertical order of message arrows shows the sequence of interactions, with time proceeding down the page. Since the message m(C) is shown above m(D) ,
this means that m(C) occurs before m(D) . The receipt of m(C) by v2[B] must therefore occur before v2[B] can send m(D) back to v1[B] .
Therefore, the statement "Receiving m(C) must come before sending m(D) " is always true in this diagram.
B, C, and D are not necessarily true based on the diagram alone: B) "Sending m(D) is the first occurrence of this scenario" is not depicted. C)
"Receiving m(D) is the last occurrence of this scenario" is also not depicted. D) "All occurrences of v[1] will happen before all occurrences of v[3] " is
not something we can infer from this diagram since v[3] is not involved in the interactions shown.
Therefore, the correct answer is:
A. Receiving m(C) must come before sending m(D).
[Reference: Object Management Group (OMG) Unified Modeling Language (UML) Specification Version 2.5.1 Section 17.3 on Sequence Diagrams, which
explains the interpretation of message ordering., ]