BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Model Driven Development and Domain Specific Language Best Practices

Model Driven Development and Domain Specific Language Best Practices

This item in japanese

Model Driven Development has seen an increased interested over the past few years, mainly in association to Metaprogramming, "textual-DSL" and language workbenches like Xtext or MPS. Markus Voelter, who has contributed significantly to these technologies has published an update to his 2008 paper on "MDD and DSL Best Practices". One of his key updates is stunning:

Modular languages are possible, languages can be extended, and the distinction between modeling and programming goes away almost completely. This has far-reaching consequences for how model driven development can and should be approached.

Even though, Markus still thinks that making a DSL "Turing complete" is a possible sign for a DSL on the wrong abstraction level, he explains:

the ability to extend existing languages (such as it is possible with MPS, Spoofax, and to some extent with Xtext2), makes it possible to build domain specific languages as extensions of general-purpose languages. So instead of generating a skeleton from the DSL and then embedding 3GL code into it, one could instead develop a language extension, that inherits for example expressions and/or statements from the general-purpose base language.

He still thinks that it is preferable to build a DSL than extending, say UML. However, with tools like MPS which come with a built-in version of Java that can be extended. So if a DSL is intended to be integrated with Java, then it makes sense to extend generic languages. In particular, he recommends to learn from 3GLs how type systems work and implement similar rules in your DSL using some new capabilities of language workbenches like MPS, Xtext or Spoofax.

When it comes to Viewpoints, Markus has also evolved his position quite a bit. The concept of viewpoints has been a strong belief of our industry based on the credo that a software systems cannot generally be described by a single notation for all relevant aspects. This is generally reinforced by different roles involved at different times in the system construction process.

the advent of real language modularization with tools like Spoofax and MPS [make it possible to represent different viewpoints] as separate language modules. Specifically with MPS where the same model can be projected in different ways (and thereby perhaps showing different subsets/viewpoints) a completely new approach for handling concerns and viewpoints is possible.

Markus emphasizes some of the advantages of using a DSL over a library. He is suggesting that using extension mechanism:

So instead of providing users a way to define libraries, users (or a couple of developers helping them) may develop their own project specific language extensions in a modular way. This has the advantage of adaptive notations and static checks plus tool support.

The definition of what constitutes a "programming language" or "domain specific language" is blurring. Yet, and in spite of so many advances in the tools and in the approaches to Model Driven Development, few organizations are heading in that direction. Why would you / would you not adopt a Model Driven approach to software development and architecture?

Rate this Article

Adoption
Style

BT