Design-time versus Runtime Code Generation

This technical article by Rockford Lhotka hits again on the eternal debate about the advantages of code generation and the differences between generating at design-time or runtime…

Design Time Code Generation and Runtime Model-Driven Generation

The ancient history of my experience was completely around runtime generation. In fact, our products are full of instances of that.

Over the last years, you’ve moved to the design-time side of the field. And there are a number of reasons for that.

This article got me thinking again. Lhotka goes out to say that the advantages of code generation are guaranteed by both approaches but “(design-time automation) doesn’t offer the flexibility and adaptability provided by runtime automation”.

The first thought that comes to my mind is that the affirmation is obviously true; but it comes at the expense of (at least) two very important “features”.

  • Complexity – just consider the complexity of a runtime that is capable of interpreting a set of models that describe a very large application (an ERP for example).
  • Performance – as dynamic behavior will always (!) be slower than static.

The first one alone is enough to make me prefer design-time! Since I’m really sick of spending so much energy solving bugs and “design issues”… :)

Published 19 April 10 04:16 by hgr

Comments

No Comments
Anonymous comments are disabled