show all comments

DSM

My DSL for mixin medical device

June 23, 2008 17:05:34 +0300 (EEST)

I mentioned previously the workshop organized by ICTNoviQ that included a metamodeling exercise. Such a hands-on part makes things more concrete and also shows the value of metamodels. I’ll post here my language for specifying the various mixin processes for the medical device. See below the physical structure of the mixing device (took from the full description).

Structure of the machine

Rather than building a DSL based on primitives provided by the framework, i.e. have objects like move, open, shut, suck, blow, filter etc. and various bindings between them, I took the physical device structure as a starting point and thought how someone would give for me the mixing instructions. Most likely it would be like “take from the second cup 5 units with a filter A and put 2 units to cup 6 and 3 units to cup 7 and then clean the needle”. This is clearly the description in the terms of the problem domain. My DSL, implemented with MetaEdit+, for the above instruction looks like:

Sample Mixin Process

The same in solution domain is the code took from the exercise:

01 move(-3); filt(1); suck(5);
02 move(4); filt(0); blow(2);
03 move(1); blow(3);
04 move(-3); suck(30);
05 move(1); blow(30);

With the domain-specific modeling language there is no need for the programmer to count the needle movement operations. The needle cleaning (code lines 4 and 5) is abstracted to a property of the role together with blow operations. If cleaning is set to the property a blue drop is shown in a model. This choice also enforces the domain rule: nobody can now clean the needle after taking the medicine into it. For the same reason I decided to omit the cups related to the cleaning from the DSL. The language also fixes the filter use by providing a property for the suck role with filter selection (none, A, B). Second typical example on how DSL enforces the domain rules and hides unnecessary complexity.

More complex structures, like wait times, iterations or repetitions over the same operations could be easily added to the language by extra properties and bindings that the current sample does not yet show. Note also that all features are not worth to model, even at the domain level, if there is no variability. For example, shutter operations can be produced by the generator if can’t be put to the underlying platform.

DSM

MetaCase named as Top Influencer by Software Development Times

June 03, 2008 17:43:07 +0300 (EEST)

"MetaCase continues to demonstrate leadership in the area of Domain-Specific Modeling, improving developer productivity while helping the industry get the message about the power of DSM," said Alan Zeichick, editorial director at SD Times.

We at MetaCase are naturally deeply honored. It is very gratifying to be selected again and notify how the popularity of Domain-Specific Modeling is raising. It is not only exciting for us as a tool vendor, but thrilling for us as software developers. An increasing number of organizations - from automotive giants to embedded device manufacturers - are radically improving their software development performance, and we're proud to be leading this move forward.

It is particularly interesting to see how “meta” has became relevant in other categories than modeling too. See the complete SD Times TOP 100 list.

DSM

DSL design contest: a case of medical device operations

June 02, 2008 13:33:23 +0300 (EEST)

ICTNoviQ organizes a workshop on creating DSLs, including a contest: During the workshop participants implement a DSL for a medical device to create different medicine mixing processes. The domain is small and clearly bounded and the contest assignment suggests several ways to raise the level of abstraction. It is up to the language designer to choose which parts is put to the modeling language, what generators do, and which parts are left to the domain framework.

My schedule does not permit participation, but I implemented the language anyway - there is a promise that the designers of the “best” DSL will be rewarded ;-) Although I doubt that remote participation in competition is possible I sent my DSL, implemented with MetaEdit+, to the organizers anyway. If you are interested, take a look of the domain description as it nicely hints about several ways to implement the language. I’ll post my version of the language after the workshop (held 18th June).

DSM

DSM and Software Product Lines - a marriage made in heaven? A panel at Code Generation 2008

May 23, 2008 11:05:07 +0300 (EEST)

I didn’t plan to continue writing blog part 3 on capturing variability with DSM, but Mark Dalgarno invited me to the panel at Code Generation 2008 on Model-Driven Development and Software Product Lines. Other panelists include Danilo Beuche and Markus Völter. I know, or at least have a good hunch, that they agree on what I wrote in the previous posts (1, 2). If I’m wrong, they now see places to attack ;-)

Seriously, I’m expecting that we go into further details and discuss how the models (in a wide meaning here) are set-up for a product line, how to deal with scalability, how to represent variability, do we expect that all software engineers master the product variability or can we hide it making move to development in product lines easier? Our experiences on some of these issues are described in the paper I wrote with Steven Kelly for SPLC Conference in which we review 20+ cases on applying domain-specific languages in product lines.

Hope to see you in Cambridge.

DSM

Capturing variability with domain-specific modeling languages (Part 2)

May 21, 2008 14:03:50 +0300 (EEST)

When defining a domain-specific language, or perhaps better to say here, a product line specific language, it is usually the best to start with by analyzing commonality and variability. If some parameter tables or feature models are already available they can naturally be used as a starting point. When looking the feature models, individual features usually map to objects of a modeling language and leafs of the feature tree are likely properties of the modeling constructs. Consider the two models above: A feature model on the left and a watch-specific language on the right hand side. They basically express the same product line: How watch products consists of a number of applications and of one display. Each display further contains icons, time units and a number of buttons.

Feature Model and DSL model of Watch product line

The difference between these two models is that they operate at a different level (and satisfy a different purpose). The domain-specific model on the right specifies individual products and shows five different watch products. One of them, called “Ace” is inspected in further detail by showing its display specification. A display “X334” shown in the dialog specifies the icons, time units and buttons of the “Ace”. The dialog thus covers the variation expressed in the feature model, except the root feature “Watch Model” and “Application” part (more on the latter later).

A closer mapping to the feature model we can see from the metamodel of the DSL since the metamodel does not include instance data, individual product specifications. The feature tree is basically mapped to the aggregate structure among the language constructs. Instead of using feature models as a starting point we may naturally apply parameter tables too, albeit they usually lack of formal specification of the dependencies among parameters (among variation points).

Metamodel of DSL of Watch Family

Most importantly, a domain-specific language can also cover variation that feature models, wizards or parameters tables can not express. This makes them to be on the creative side in Czarnecki’s scale. For instance, the metamodel above expresses that display names must be unique: we can’t have two displays with the same name meaning different displays. The expressiveness of DSLs over feature models becomes more evident when inspecting variability that is dealing with dynamic, behavioral variability. If we stick with the digital wrist watch product line, we have also variability in terms of:

  • execution order among various watch applications (e.g. coaches prefer stopwatch whereas travelers prefer worldtime)
  • how buttons are used to activate and use watch applications
  • how and when icons are shown
  • how time is displayed and calculated, etc.

This kind of variation would be impossible to specify in feature models or other techniques that focus on static variation only. In DSM, this variation can be expressed in the language too by adding them to the metamodel. This is done by having various kinds of relationship types between the objects, role types the objects may have, port types and port rules, various submodel structures and so on. For instance, execution order among applications can be specified by a transition relationship type. In addition, two roles types are needed to specify the direction of the transition, like ‘From‘ and ‘To’ roles.

In practice, covering variability often calls for multiple languages. A typical pattern is to have separate languages for static variability and for dynamic one. The metamodel below describes behavioral variability in a single watch application. You could see it describing the variability in an application: something that we could not describe in the feature model shown above. The metamodel identifies various transitions among the watch applications, their internal states and different kind of actions a watch can have. Such as set time, calculate time, alarm-related actions, icon visualization and so on. When the metamodel is instantiated it can be applied to specify watch applications as shown in the previous post.

Metamodel of DSL of Watch Application

The two metamodels illustrated above, however, are not isolated but integrated. This integration is simply needed because a variation can deal with multiple aspects. Consider for instance the specification of icons in the digital watch. In the metamodel (and in the feature model) we specified that there can be a number of icons, but not yet when and how they are applied. In the second metamodel, addressing behavior, the same icon concept is now used in relation to actions: showing and hiding the icon (these are highlighted by a red circle).

The integration among several languages can be specified again via the common metamodel. When the languages are integrated the life for developers becomes easier as they don’t need to maintain the same information in two (or more) places. Since both metamodels can be instantiated in practically infinite different ways the possibilities to handle greater range of variation and create new functionality that is not yet developed makes DSM especially suitable for product lines.

DSM

Capturing variability with domain-specific modeling languages (Part 1)

May 15, 2008 14:05:02 +0300 (EEST)

One typical place to apply domain-specific languages is to express variability: When developing multiple similar products you have a language that describes what is different among family members. In this post, and in coming parts, I discuss how modeling languages can be defined for product lines. For the start I use Krzysztof Czarnecki's classification as he nicely illustrates the range of variation and different ways to handle them (see figure below).

Range of variability and language support

Wizards recognize the dependencies that pure parameter list ignore. Wizards typically expect that all functionality is already available and the number of variation points is usually rather modest. Feature models, instead, are used to manage a larger number of variation points but are still limited - by nature variability is not only in static structures or come in a structure of a tree. You may see an illustrative example of this by looking the Feature Model example I implemented (source available in MetaCase Forum). The sample feature model illustrates the variation in a digital wrist watch product line. With Feature Models we can’t express variation that deals with behavior side, like for instance execution order. While several extensions are proposed for feature models their best use is at planning and analysis phases rather than in creating variants.

Richer and larger spectrum of variability, notably also dynamic behavior, can be covered with domain-specific languages. Krzysztof uses the wrist watch as an illustration of a DSL This example product line is supported by two languages, one targeting static variation and the other, as illustrated in the figure above (see a bigger picture here), targets more the dynamic parts. Since the language's concepts (metamodel) can be instantiated in many different ways, a domain-specific language can handle a greater range of variants. If the language is based on some more expressive model of computation, like state machine in the figure above, there are also capabilities to create functionality that is not yet available! This is most relevant in practice since we almost never have situation in which all variability is available and we can just pick among them.

Looking from the language design perspective this means that variation is not expressed purely as values to be selected (parameters in a table or features in a tree) but also with dedicated types: Variability is supported right in the language. In terms of metamodeling variation point is not just a property value of an object, but it can be a role that an object may have, a relationship that connects objects, submodels or diagrams an object or a relationship has to specify its details, links to other elements properties, ports and so on. If we step outside the basic language concepts that modeling languages have, such as Graphs, Objects, Roles, Relationships, Ports, Properties, further variation space can be set with rules related to languages, such as how many instances can be in a model or a single diagram, how many times a certain element may connect to another kind of element, etc.

I’ll discuss guidelines for creating domain-specific modeling languages to specify variability in coming posts.

DSM

The 8th workshop on DSM @ OOPSLA, 19-20 Oct

May 14, 2008 16:23:14 +0300 (EEST)

The 8th workshop on Domain-Specific Modeling is organized this year in Nashville as a part of OOPSLA. We run again two days and look for submissions on experiences, ideas and demonstrations. Two days give us a great possibility to go into details on creating and using domain-specific languages and code generators in various domains. Call for papers and participation is available.

Photo from DSM'07 (Montréal)

DSM

New version of MetaEdit demonstrated at JAX 2008

April 16, 2008 18:10:53 +0300 (EEST)

JAX 2008 runs this year a special track on DSLs. I have the pleasure to start the day and demonstrate the new version of MetaEdit+.

This is a bit special kind of day since it is heavily tool focused. It allows to show something concrete and working. I plan to show the bacic goodies but also the advanced stuff like language evolution (change an existing domain-specific language in use in all different ways), update models automatically to the new language version, integrate changes in metamodel to generator, link back from code to models and other features our customers have found relevant in practice. Reversing code to models with MERL, Icon Editor, new metamodeling tools are also on my list but I’m afraid my 1h slot does not allow to show all the details.

Hope to see you at Wiesbaden!