0
2.2kviews
Define constraints. How they are applied ? Give example OR What are constraints? How they are applied?

Subject: Object Oriented Modeling and Design

Difficulty: Medium

Marks: 4 Marks

1 Answer
0
86views

Definition: Constraint is a Boolean condition involving model elements such as objects, classes, attributes, links and associations. A constraint restricts the values that entities/elements can assume.

Notation: Constraint is shown as text written inside curly bracket. {Constraint}

Example: -

Constraints on Objects: In the above example a constraint is specified as salary<=boss.salary inside curly brackets. It restricts the value of attribute salary of employees with respect salary of boss.

enter image description here

Constraints on Links:

enter image description here

Please log in to add an answer.