UML&OCL Modeling Languages
OCL Constraints: illustration
- As an exercise, represent the class diagram for persons having an age and children/parent then express the following constraints:
As a preleminary exercise, you can install and try USE tool that proposes an OCL interpreter.
- The age of parent is greater than the one of the children.
- Parent and children relationship are inverse relations.
- One can not be its parent/children.
- Constraints on operations are expressed by pre-post conditions illustrated below:
context Person::birthday()
pre:
post: age' = age+1
The prime' represents the value of the attribute after execution.
As an exercise, how to define the addChildren(p)
?
4 - 9thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL
thiry laurent ensisa uha alsace mulhouse france unified modeling modelisation language constraint object objet UML OCL