I came across couple of questions about OCL expressions. After reading some university slides and googling it I still cannot properly understand it.
I wonder if any of you guys know any good resources that I should read to understand this stuff.
Constraints that bother me:
For the 1st one I have:
context Department
inv self.stuff -> forAll(manager = self.staff.manager)
2nd one:
context Company
inv self.employee -> select(manager = manager.manager) -> isEmpty()
3rd one:
context Company
inv self.employee -> select(salary > manager.salary) -> isEmpty()
but I dont think these are right. What I'm most unsure of is whether in example 2 and 3 I actually compare individual employees with theirs actual manager / manager salary.
Finally got something good!
This is very informative document (PDF) from Object Management Group (OMG):
Object Constraint Language Specification
I love answering my own questions :)