2011-02-10

There's no such thing as platform-independence.

The central model in the Model-Driven Architecture (MDA) is the Platform-independent Model (PIM). The functionality of a system is specified it in a way that is independent of the platform used to implement it. To realize this implementation, the PIM is transformed into one or more platform-specific Models (PSM), from which source code is generated in a programming language like C, Java or .Net. That of course still needs to be compiled into machine code or byte code, but that is so obvious that it is usually not even mentioned.

The vision of MDA is attractive: to isolate the specification of system from continuous change in current implementation platforms. The idea is that if they change, you just have to develop new transformations to PSM's for the new platform, and new code generators. The specification of the system as a PIM remains unchanged.

One widely used programming languages used as a target for code generation, is Java. That's funny, because Java itself is already platform-independent. The C programming language actually is platform-independent too, but only at the source level, so that it has to be recompiled for any combination of the underlying operating system and processor architecture. But Java itself is also a platform for which alternatives exist, like .Net/C#, Scala or Ruby.

What has become of the vision of the MDA? In any case, it has not become a resounding success. Otherwise we would now all be working with MDA. In practice, there are many practical problems associated with this approach, making it less ideal than it seemed at the time. Partly because MDA relies heavily on UML, which is not designed, and not very suitable, for code generation. The approach that resembles the MDA the most is based on Domain-Specific Languages (DSL), but the differences are significant. If ten years ago you had specified all your systems as PIM’s in UML, they would now be pretty worthless. In theory, of course you could write a transformation into a platform that is now common, but that is not as easy as it seems.

In fact, the MDA with UML is also just a platform. And a platform independent-model is not fundamentally different from a program. Only the language is different. And that is the fate of any programming or specification language that is presented as platform-independent in the beginning. Eventually, even when the platform is successful, or perhaps especially then, alternatives will be developed, just like C# was developed as an alternative to Java. And then we will need another platform-independent platform from which code for these various alternatives can be generated. And so the circle is closed. Platform-independence is a moving target, an illusion, a utopia. There is no such thing!

No comments: