Applicability of the Profiling Concept to IBM Rational Software Modeler

The RSM has an integrated facility for the definition and application of custom profiles. Unfortunately the tool is missing the enforcing mechanism of constraints defined in the custom profile (only OCLE provides such a concept, on the other hand the OCLE tool is not compliant with UML 2.0). However, as already mentioned, the profile definition concept offered by the RSM tool allows to design profiles or more precisely constraints in different ways, for example as an informal language, in OCL or as Java code. Especially constraint description in Java proved to be an interesting alternative in comparison with the others (informal language, OCL), because the RSM tool uses the UML2 plug-in that implements the UML2 metamodel and in addition to that provides Java APIs for accessing UML2 models. It has been discovered based on experiments that writing constraints in Java code using Java APIs of the UML2 plug-in is simple and even more powerful than defining constraints in OCL (see figure showing the RSM tool and the implementation of a constraint in Java).

The RSM uses the same implementation of the UML2 meta-model as provides the UML2 Eclipse plug-in. This allows the custom validator class CustomProfileValidator to be used with small modifications either in a standard Eclipse environment as well as in the RSM environment. Since the preferable modeling tool is RSM, here is a list of concrete steps that lead to adapting the profile enforcement concept to the RSM environment:

  • The RSM has a proprietary validation framework for validation of UML2 models. In order to prevent validation against UML2 proper, the EthFWProfileValidatorModeler class is defined that extends the UML2Validator and overrides its validate() method. The EthFWProfileValidatorModeler class is generated from the profile definition.

  • The helper class EthFWProfileValidatorModelerHelper of the Eclipse plug-in is adapted to seamlessly integrate with RSM which has a proprietary error reporting framework.

  • The EthFWProfileValidatorAdapter is defined to extend the AbstractModelConstraint of the RSM validation framework. The adapter triggers the generated profile validator if the user switched the the profile validation on using a toggle button.