Hitchhiker's Guide to Software Architecture and Everything Else - by Michael Stal

Sunday, February 08, 2004

Model driven - Panacea or Myth?

When I first saw the MDA (Model-Driven Architecture) approach of the OMG a few years ago I was more than skeptical. To me it sounded like: Just take an platform-independent architecture model, introduce a platform-specific model, and generate the code. Life can be so easy :-) The problem why most experts did not believe (and some of them still do not believe) in MDA was the fact that marketing and tool vendors made everyone believe this would work for every domain and every platform. It simply appeared to be the arrival of the GPS (General Purpose Problem Solver). If you take away marketing stuff and don't confuse MDA with model-driven approaches in general, then people tend to be more optimistic. Let me introduce an example. A (very clever) colleague of mine, Andrey Nechypurenko, most recently did something which was very "easy" and at the same time very smart. He took Visio, introduced some domain-specific shapes for a customer, and wrote code using VBScript that traverses the model and generates code. Instead of handcrafting their code and configurations (code can have several thousand lines), developers now can just draw their domain model and let the generator do all those tedious, and error prone boilerplate code. They don't use this approach for most of their system, but only for parts that can be automated. Basically , these are the parts that are best understood, require a lot of work to handcraft, and support automatic generation. Note, that not only code can be generated but also any other artifacts such as XML files, documents, just add your own. Expect some further research in this area from Vanderbilt University (Doug Schmidt) in cooperation with Siemens. This area is so fascinating as we can (re-)use all our knowledge in areas such as UML, patterns, frameworks, middleware. And it is not that new. If you've read the exellent book "The Pragmatic Programmer", you'll notice the section about code generators which deals with model-driven generation of code fragments. Basically, all of us, at least if we are programmers, are already applying the principles of model-driven engineering. Every programming langauge helps you to define a model from which code is then generated to run on a (virtual) machine. Today's model-driven approaches differ from this trivial kind of MDA in that they define models on much higher abstraction levels. So what does this mean to us? It simply means don't confuse MDA with model-driven approaches in general. Model-driven concepts may not help to automate software development, but they can offer a significant amount of help. You don't even need to use a specific model, but just can rely on tools such as Visio, Rose, Together, JBuilder, Eclipse, Visual Studio, add some plug-ins and start model-driven engineering.