Model-Driven Software Development - ready for prime time?
I’ve written a little opinion piece for Matt Deacon’s newsletter for software architects. It’s entitled Model-Driven Software Development - ready for prime time?
–
The history of software development has seen a steady lifting of the level of abstraction at which practitioners operate. Languages such as COBOL and FORTRAN largely replaced assembly language programming. Higher-level languages such as C have largely displaced these languages, and C itself has been marginalized by C++ and Java with the widespread adoption of object-orientation.
Some see Model-Driven Software Development (MDSD) as the next evolutionary step in programming technology. A recent survey by MediaDev established that 39% of developers were either already using model-based code generation or were planning to use it. Awareness of some of the key approaches “ Software Factories and MDA - is also high - running at around 70%.
A personal illustration of this interest came last year when I started running a series of software talks in Cambridge, England with Alan Cameron-Wills, now part of Microsoft’s Solutions Framework group. As our first speaker we invited Steve Cook to give a talk on Software Factories. Now with this being a first-time event we hoped for around 20 people to show up so you can imagine our surprise when 55 people turned up - we only just had a big enough room for everyone!
But like our audience that evening, most developers approach model-driven techniques with a healthy dose of scepticism. Some tool vendors aren’t shy of promoting their latest offerings as the next silver bullet, and old hands may remember being burned by CASE tools in the late eighties and early nineties. So is anything different this time around?
One difference this time around is of course that it’s not our first time around. We’re older and wiser and have learned some lessons from the broad failure of earlier approaches.
One of the most promising outcomes from this experience has been a shift in focus, at least for some people, away from general-purpose modelling languages to Domain-Specific Languages (DSLs). Instead of trying to support all possible software problems, these languages concentrate on a specific subset of problems (a problem domain) such as mobile games, security policy enforcement or generation of GUIs. By focussing on a specific problem domain such languages should map more closely to the desired solution and so should be easier to develop, optimise and use.
However, despite interest in DSLs and the undoubted success of some MDSD projects the issue of trust is still present - How can developers be confident that the generated code is as good as code they could have written themselves?
One answer is that the same issue has cropped up before when moving from assembler to high-level languages and from C (say) to C++ and once compilers were good enough most people adopted them - it was simply more productive to do so.
A second answer is that some MDSD tools allow the developer very precise control over the generated code. The issue then becomes one of how good your developers are at writing generators to map from the model into code.
A related point is the area of round-trip engineering - being able to generate models from code as well as code from models while keeping both sets of artefacts in step. In some cases there may be a need to add to the generated code in order to address some deficiency in the modelling or generation process. One solution is to allow hand-written code to be mixed with the model and then integrated with the generated code. The emerging power of language annotations may help address the reverse code to model transformation process.
Pressure for solutions in these areas comes from the fact that software systems are getting bigger and more complex and new technologies are emerging at such a rate that our existing tools and approaches are reaching their limits. Some new paradigm is required to address problems of comprehension, productivity and maintainability and MDSD is emerging as a strong candidate.
–
I expect there will be some healthy debate around these issues at May’s Code Generation 2007 event.
