What is a guard in the context of a combined fragment?

Study for the OCSMP Level 1 Behavioral Test. Prepare with flashcards and multiple choice questions, each question comes with hints and explanations. Get ready to ace your exam!

Multiple Choice

What is a guard in the context of a combined fragment?

Explanation:
A guard is a Boolean condition attached to a combined fragment that controls whether the fragment’s inner interactions will occur. In UML sequence diagrams, this condition appears in the fragment’s header and is evaluated before any messages inside the fragment are processed. This gating explains why a fragment only participates when the guard is true, and, for an alternative fragment, only the operand whose guard holds true will execute. The other concepts don’t fit: a time constraint sets timing limits, a state invariant describes a condition on a lifeline’s state, and a message label is simply the name of a message, not a gate for the fragment. So the best description is that a guard is the Boolean expression that governs the fragment’s activity.

A guard is a Boolean condition attached to a combined fragment that controls whether the fragment’s inner interactions will occur. In UML sequence diagrams, this condition appears in the fragment’s header and is evaluated before any messages inside the fragment are processed. This gating explains why a fragment only participates when the guard is true, and, for an alternative fragment, only the operand whose guard holds true will execute. The other concepts don’t fit: a time constraint sets timing limits, a state invariant describes a condition on a lifeline’s state, and a message label is simply the name of a message, not a gate for the fragment. So the best description is that a guard is the Boolean expression that governs the fragment’s activity.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy