uDifficulty
is in creating a grammar to help specify the rules.
ØNatural language is not precise enough.
ØSolution is to place the rules at the object
level but support an Object Constraint Language (OCL)-like
syntax that allows you to validate across classes.
ØRule to say that a department must have at least
one employee (in the standard EMP/DEPT 1-to-many model) would be
written as:
§:_child.emp.count
>= 1
uThis
grammar can be easily extended to support 99% of all
rules encountered.