A reader sent me the following Eclipse model that was clearly as not well-formed: a class was the subtype of an interface!

This left me wondering how he had managed to draw such an incorrect model. Weren’t the Eclipse UML tools unable TO prevent this obvious mistake? The short answer IS NO (long answer below). I’ve tried three different modeling tools based on the Eclipse UML2 implementation and all allowed me to draw the following class diagram:

At that point I decided to contact Javier Muñoz from the MOSkitt Eclipse-based modeling platform to know what was going on. He told me that the UML2 metamodel implementation in Eclipse offers on demand validation of some well-formedness rules . Even if we ignore for a moment that not all validation rules defined in the UML standard are implemented, this means that an Eclipse-based UML modeling tool could:

  1. Never call the available validations operations (no guarantee that the model is ever correct)
  2. Call them only when the user explicitly asks for it (correctness is only evaluated at a certain points of time; it is up to the user to interpret the validation feedback and modify the model accordingly)
  3. Implement some kind of notification service to call them after every model change made by the user (correctness is instantly evaluated but it is up to the user to correct the mistakes of his/her last actions)
  4. Prevent the errors by calling the validation operations before recording the user action in the model (i.e. “rolling back” the user action if this action evolves the model to an incorrect state).

Unfortunately, I’ve FOUND several “instances” OF the FIRST GROUP AND AT least one OF the SECOND one but I’m not sure if we can find tools belonging to the third or fourth groups (do you know any?), the only ones that seem acceptable to me (specially the fourth). The other options are too risky.

Maybe I’m a little BIT too picky here but I don’t see the point on building fancy tools for all kinds of advanced modeling languages and techniques if we cannot even provide the functionality required to prevent users from doing basic mistakes.

Note that these basic mistakes I’m referring TO correspond TO the well-formedness rules defined IN the standard. There IS a distinction BETWEEN these basic rules AND other quality problems we can find IN models AND that may be acceptable depending ON the purpose OF the model OR the phase IN the development process IN which the model IS used (e.g. IN the early stages OF the process, models ARE usually incomplete AND can have inconsistencies BETWEEN the different “diagrams”, AS operations IN a sequence diagram that ARE NOT yet defined IN the CORRESPONDING classes OF the class diagram; this IS part OF the model refinement process). TO me, a class that subtypes itself IS always wrong, under NO circumstances this should be allowed.

I don’t believe a continuous validation can cause efficiency problems either. Checking these basic rules is not exactly rocket science and can be efficiently implemented (and many techniques, like the ones I developed in my thesis , could be used to determine the minimal model subset that needs to be reevaluated after every user update to improve efficiency when dealing with very large models).

Maybe, for once, Eclipse tools should learn from ArgoUML that has already been offering this functionality (group 4 from the list above!!) for many years

 

All modeling trends in your inbox

All modeling trends in your inbox

Follow the latest news on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This