Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context: Constraints capture additional rules that cannot be expressed simply by standard connectors or multiplicities. UML provides a general note mechanism and an explicit constraint syntax to annotate model elements and relationships, improving precision while keeping diagrams readable.
Given Data / Assumptions:
Concept / Approach: UML allows attaching a note (a dog-eared rectangle) to one or more elements via a dashed line. A constraint can be written inside the note, often enclosed in braces { } or expressed in a formal language such as OCL. When a rule involves several symbols, linking a single note to each relevant element communicates the dependency clearly and avoids cluttering the diagram with ad-hoc text near each element.
Step-by-Step Solution:
Write the rule concisely inside a note (for example, {An Order must reference at least one LineItem and one Payment}).Attach the note to all affected elements with dashed lines.Optionally, reference the constraint in documentation or use OCL for formal semantics.Confirm the diagram remains readable and unambiguous.Verification / Alternative check: Compare with embedding text near each symbol or inventing new icons; the note approach is standardized and widely supported by modeling tools, ensuring consistent interpretation.
Why Other Options Are Wrong:
Common Pitfalls: Overloading notes with long prose; failing to attach the note to all involved elements, which can obscure scope of the rule.
Final Answer: Correct
Discussion & Comments