1

Hopefully, this question isn't too generic:

Conventionally, MDSD is defined as the conversion of model specifications into sources of compilable programs.

Besides this, one could interpret a model.

While interpretation typically tends to be slower, the deployment of an updated model could be simpler.

In general: Why would one compile a model using MDSD? When should one interpret models?

SteAp
  • 11,853
  • 10
  • 53
  • 88

2 Answers2

1

What you are talking about is "executable specifications". This works when your specification is complete (e.g., covers all the cases; many current "models" aren't complete, or are complete only by virtue of additional Java source code text in the middle of it, which isn't easily interpreted), and your interpreter is fast enough so the user base doesn't care.

But that's the rub. The whole reason compilers exist is because interpreting specifications is usually 100x slower than a compiled equivalent. (Ever seen or used a C interpreter for real?).

I don't know of many people that execute "models". I think they all believe that an interpreter would be too slow, or they get hung on the model incompleteness/low level source code impedance mismatch.

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
  • Thx Ira! I understand your points, but wouldn't accept it in all. E.g. slower interpretation need not be a problem, if a model only defines layout and general behaviour of a GUI. – SteAp Apr 28 '11 at 21:02
  • @Stefan: I covered your case: "... when your interpreter is fast enough so the user base doesn't care". If interpreting the model to draw the GUI is small overhead compared to drawing it, then you can use an interpreted model. (Not interesting? Your question is only 1 day old!) – Ira Baxter Apr 28 '11 at 21:05
  • Very interesting! I'd like to get more answers, but felt, that it's polite to check the current one - since so few other answered yet. Or even reviewed the question. – SteAp Apr 28 '11 at 21:17
  • I'm very intered_ted_! Thx for pointing out the GUI point again. – SteAp Apr 28 '11 at 21:24
0

Both strategies can be valid and valuable under certain circumstances.

When possible, the model interpretation strategy is probably better than the compiled one, since you simply have to modify your persisted model to change the behaviour of your deployed application, without recompilation and deployment.

But you probably need to use the compilation strategy when :

  • you cannot express (or don't want) 100% of the required reality in your models. In this case, you probably want to write manual code inside generated code.
  • performance is a key issue for your application

I recently developped a GUI model editor, interpreting its models on the fly to render fully operational Form editors. Performance was not a issue, but code was nevertheless generated for these GUIs, since we had huge GUIs with thousands of parameters (for a space flight dynamic application), and many custom UI behaviours that required some additional source code to be fully implemented.