A signi?¬?cant problem with OCL is its tight coupling withUML
and MOF: to use OCL, you must useMOF as your meta-metamodel; using MOF, you
can only build modeling languages that share a number of similarities to UML.
Adifferent approach is to use the same domain-speci?¬?c language for constraints as
for code generation. This allows the use of a language speci?¬?cally designed for
navigating over models, without forcing the user to learn yet another language. If the
output of generators contains links back to the corresponding model elements, the
warnings and error messages output by failed constraints can be clicked to go straight
to the offending place in the model.
An interesting combination is to have the modeling language symbols directly
contain elements for showing failed constraints. This places the error exactly where it
should be, and makes it visible at the same time as it is caused??”no need to explicitly
run a constraints check. There are still cases where some constraints should be left to
be run explicitly and as a test before generation: for example, if the constraint will
often be broken, or checking it takes too long for execution on the ?¬‚y.
14.3.2 Notation
If the meta-metamodel sets bounds on the abstract syntax of your modeling language,
the notational features offered bound its concrete syntax.
Pages:
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714