A Constraint represents additional semantic information attached to the constrained elements. It is an assertion that indicates a restriction that must be satisfied by a correct design of the system. The constrained elements are those elements required to evaluate the constraint specification. In addition, the context of the Constraint can be accessed, and can be used as the namespace for interpreting names used in the specification.
A Constraint is represented as a linguistic, enclosed in braces ({}), statement in some formal (OCL, C++, and other), or a natural language. There are 14 standard constraints in UML such as association, global, and parameter. You can also define your own constraints.
You can create the following constraints:
Constraints can also be used to define validation rules for your model. |