hide all comments


Heavy use of generators: Single source, multiple targets

March 19, 2013 09:23:43 +0200 (EET)

When our consultants are involved in language development, whether assisting in the beginning, providing training or participating in modeling language implementation, we typically sign an NDA. And after signing the NDA our mouths are closed. That is natural since users of MetaEdit+ own the languages they develop - and hopefully we were able to support them.

Occasionally we get across with cases that permit publishing some more details of the DSM solution, like what the language looks like or what kind of artifacts are generated. The best cases are those where language engineers and users are allowed to describe their experiences. For me, the use of Domain-Specific Modeling at Hofernet is particularly nice as they apply heavily generators. Hofernet IT-Solutions has created a domain-specific language targeting automation systems for fish farms. FishFarm DSL uses the domain concepts like ponds, feeders, water levels, etc. directly as language constructs. It is thus truly domain-specific having a narrow focus and raising the level of abstraction. This DSM solution is also a prime example of making models work: models provide a single source and then generators produce the rest.

An example model created with the Fish Farm DSL

First of all, after modeling the fish farm they generate the code for the automation systems - running as PLC code with a specific platform. In addition they also generate the UI application code so that the fish farm owner can use his touchscreen device to follow the status and control the operations of the fish farm.

While most companies would be very happy with the possibility to generate code for production use from the high-level models, this is just the beginning with Hofernet's FishFarm DSL. Since the fish farm as a system contains also hardware, generators produce also configuration for the devices in the network as well as hardware mappings. Generators produce also configuration for the web portal.

A particularly notable part is the document generation as it is needed to install and maintain the system in operation. Thus they also generate wiring plans, list of parts to be installed and even the labels to be attached to the wiring closet.

use of code generators with Hofernet's Fish Farm DSL

All in all, FishFarm DSL by Hofernet is a prime example of doing model driven development in the right way: single source in models generating multiple target formats. No need to maintain the same information in different places, checking consistency, diffing and merging various models and formats. A more detailed description will be published in the special issue of DSM in the Journal of Software and Systems Modeling. An electronic version of the article is already available by the publisher.

People reading the case has said that it makes perfectly sense in the domain of fish farm automation. Obviously the prime reason why it works so well is that the creators of the language have narrowed down the domain well and raised the level of abstraction. This is how good languages should work. If you are interested in reading cases from other domains than fish farms, check an article reviewing 76 cases of DSM, a paper focusing on 20+ cases in product line companies or try out the 4 industry cases described in the book on Domain-Specific Modeling.

The truth is that there exists thousands of similar narrow domains like fish farm automation systems - and I suspect that the one you are working with is one of them. If you would like to chat about the possible case, feel free to contact me (jpt _ metacase.com).