Class Diagram - Classes and packages Constraints

類圖 模板。 Class Diagram - Classes and packages Constraints (由 Visual Paradigm Online 的類圖軟件製作) 編輯此模板

A constraint is an UML expression that constrains the semantics of an element, and it must always be true, or in other words, it is a restriction on an element that limits the usage of the element.

  • A constraint is one of three UML’s extensibility mechanisms: Steretypes, Tagged Values and Constraints. A constraint extends the semantics of a UML building block, allowing you to add new rules or modify existing ones.

  • A constraint is a condition (a Boolean expression) that restricts the extension of the associated element beyond what is imposed by the other language constructs applied to that element.


{xor} is a predefined UML constraint. The {XOR} means that class MilesAccount must have either an association to Person Owner or to Company Owner but not to both or none.