Skip to main content
Post Made Community Wiki
Source Link
Daniel
  • 471
  • 2
  • 12

I had the discussion, and would love to do MDA, but the biggest drawback is tool support for now. I am using a derivation of MDA which I like to call "Runtime Model evaluation", but more on that later.

The drawbacks of MDA are, as I know:

  • Missing Refactoring Support: Lets guess I want to model the entities of my datamodel with MDA (Typical usecase No. 1). If I have my model in, lets say, an UML diagram, and I change it, nothing of my code changes with it (at least the generated classes), and instead of having still a working app with better named attributes, I get a lot of errors I have to correct manually.
  • Missing debugging support: Usually translations from model to code are done by having some transformation language at hand. This would be no problem usually, but when we debug, we optimally should not be worrying of the code we generate, and a debugger should step into the transformation model. Instead it steps into the generated code, and as we all know, the transformations should look good, not the generated code. Okey, we can pretty print it, but in an optimal world the generated code is a compiler artefact, and should never have to be opened in an editor for a debugging session (I could live with it, and this argument is a bit theoretically, but it is one reason against MDA)
  • Coded models are easy: In other examples, the Model could model some domain aspect, and which is then compiled into code. Yes, it is MDA, but most MDA models are just sophisticated configuration files, which could easyly be handled at runtime.
  • Transformations are hard to test: If you use transformations in a specialized IDE, they are done by the IDEs "compiler". But the transformations have to be seen as part of the code of the application, and as such should also undergo the test and code coverage requirements of the app.

What I currently prefer is "Runtime Model Evaluation" (if someone knows an accepted name for this please enlighten me). My entities are stored in ordinary Java classes, and everything I need to "model" is made by annotations I read at the start of the app. No transformations needed, it was just a bit hard to get my meta model right.

Everything else is either done with property files or XML for hierarchical data. If you have a model, it is always hierarchical, so there is nothing you can model which you cannot also express with XML. And if you need a special model editor, which you probably will have to write also, you can as well build an editor which even works at runtime of the app, and makes the app more configurable than everything you could model.