UML&OCL Modeling Languages
OCL Constraints: sample tool
c. Then, use OCL interpreter to manipulate the model
Sample expressions:
Person.allInstances
Person.allInstances.collect(p|p.age)
Person.allInstances.select(p|p.age<0)
Person.allInstances.select(p|p.age<0)->size()
Person.allInstances.select(p|p.age<0)->size()=0
Person.allInstances.forAll(p|p.age>0)
In particular, the following expression corresponds to an invariant:
Person.allInstances.forAll(p| (p.age>0) and not p.children->includes(p))
7 - 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