OMG-OCUP2-FOUND100 practice question 5 of 15

In UML modeling, what is a Constraint?

Full set: 89 questions
Answer options
A: a condition that must be satisfied when it is evaluated Correct answer
B: a condition that should be met depending on system operation
C: a condition that causes the state of the objects to change over time
D: a condition that constrains what can or cannot be put in a class diagram
Correct Answer:
A. a condition that must be satisfied when it is evaluated
Explanation

According to the official OMG UML specification, a Constraint is a condition or restriction placed on one or more elements of a model. It is expressed as a Boolean expression that must evaluate to true for the model to be considered well-formed. This means the condition is a mandatory rule that must be satisfied. Constraints are used to specify invariants, preconditions, and postconditions, all of which are non-negotiable rules within the model's logic.

Why Incorrect

B. The word "should" implies optionality. A constraint is a mandatory rule that must be met.
C. This describes the effect of an operation or a state transition, which causes change, whereas a constraint restricts valid states.
D. This is too narrow. Constraints can be applied to any model element (e.g., operations, use cases) in any diagram, not just classes in a class diagram.

References

- Object Management Group. (2017). OMG Unified Modeling Language (OMG UML), Superstructure, Version 2.5.1. OMG Document Number formal/2017-12-05. Section 7.6.1, "Summary," p. 35. The text states, "A Constraint is a condition or restriction represented as a Boolean expression, which must be true for the model to be well-formed."

- Pender, T. (2003). UML Bible. Wiley Publishing. Chapter 5, "The Class Diagram," section on Constraints.

Scroll to Top