Software Factory: The ABC of DSM
Domain-Specific Modeling (DSM) does to present day programming languages, what the present day programming languages did to Assemblers – hide the nonsense.
If using plain English-like statements to write programs came as a revolution in the last generation, then drawing figures to represent our programming problems is the call of next generation.
At its core, a DSM Language lets you draw models which use a pre-defined vocabulary called a meta-model. In other words, a Meta-Model is a model that is used to define the actual model. And this model is at many levels of abstraction above the conventional modeling languages like UML, because the symbols in a domain-specific model map to actual entities of your business domain. For example, a Meta-Model for a Restaurant-Management Software will have concepts like Menu, Recipe, Caterer, Buffet, Happy Hour etc, and the model would contain symbols representing each of these concepts.
A business user then draws a model by using these symbols, and applies the rules of his business domain. Each symbol is typically worth several lines of code. The Factory experts also make Code Generation and Transformation tools specific to the Restaurant-Management domain. These tools operate directly on the models created by the business user to generate source code and other artifacts as required by the software system. The resultant is a highly efficient code and artifacts because this code generation has been automated by the experts and hence is of much better quality than what a developer codes.
Typically developers take over at this point to add all the other stuff required for the particular restaurant to make the software a comprehensive solution. Note that every restaurant has concepts like Menu, Recipe, Caterer, Buffet and Happy Hour – which means, the same Factory and the corresponding tools can be used to create software for any restaurant in the world. Once the base software has been laid down by the factory, the developers can take over to tweak and add details to make it customized for their restaurant.
The "one size fits all" philosophy of UML – where all you think is classes and objects – is highly inefficient, as the models are completely disconnected and lack any semantics of the business domain. Whereas in the DSM world, the business semantics become the prime driver to define meta-models, create models out of them, and generate software artifacts.
In the next post, I'll discuss the concepts underlying a Meta-Model.