Domain specific constraints in RSM
Adding domain specific semantics to a UML model is an incredibly useful thing to do. It enables early validation of thinking and ideally puts constraints onto the development teams that are required to help secure a sucessful delivery. It could also enable better code generation, but I’m not a fan of that!
Adding some validation constraints into the IBM Rational modelling tools is actually really quite easy, assuming that you’re not frightened of Java and Eclipse plugins. (Of course if you have no one in your team who isn’t frightened, perhaps you should just bite the bullet; it’s really not that hard you know
)
In the developerworks article Implementing a domain-specific constraint in IBM Rational Systems Developer , Steven Hovater shows how to create a simple constraint in the Rational modelling tools. Whilst the article is focussed towards Rational Systems Developer rather than Modeller (RSM) or Architect (RSA), the principles are the same and it works equally well in all these tools.
The scenario used by the article is a nice clear example using the concept of electrical assemblies that not only require an amount of current to work, but also have a maximum allowable current allowed to flow through them. Whilst electrical assemblies are certainly not application to any domain I’ve worked on, the example of validating an aggregation certainly is.
If you use the Rational modelling tools but have never thought to customise them, give it a go now. This article is a nice starting point that will show you how to create a new UML profile, stereotype (with attributes) and the validation rule.