Generative Programming

What’s it all about

You use software to automate processes. So it’s surprising to learn that the complex processes of developing software are themselves barely automated.

Although fully automated generation of entire application systems is not feasible now, and is unlikely even in the future, there are – on a more realistic level – many types of tools conceivable that can more or less automatically generate software systems.

The automation of software production speeds up software development and reduces development costs, while also improving quality, reducing errors, requiring less maintenance efforts and consequently leads to lower maintenance costs.

It’s not that these are by any means new ideas; however, the general view was that the use of object-oriented technologies had made this kind of automation unnecessary. Of course, object-oriented programming provides a higher degree of abstraction; but not automation.

It was in this environment around 1999 when the term Generative Programming (GP) turned up for the first time, and a book of the same name by Czarnecki and Eisenecker (K. Czarnecki, U. Eisenecker, "Generative Programming", Addison-Wesley, 2000) was published.

 

Generative Programming – an overview

GP is considered to be a new paradigm in software development, albeit one that doesn’t compete with current paradigms – in particular object orientation. It enhances them instead.

In addition to automating software development, the approach focuses on the realization of software system families.

 

The generative domain model

The generative domain model

In conventional development, components or entire systems with similar properties are developed individually. By contrast, the GP principle assumes that members of a system family can be generated - on the basis of a common system family model.

This model, known as the generative domain model, consists of three elements:

  1. a method to specify family members;
  2. modules from which every member can be assembled
  3. the configuration knowledge to translate the specifications into implementations.

It is similar to ordering a car: you have an order form, and then there are the components to build the car, afterwards someone who knows how will assemble the car as ordered.

Ideally, the assembling process is to be executed as automated as possible. Transferring this approach to assembling software, the last step involves generators.

There are several methods being propagated in the GP environment. Delta Software Technology uses ANGIE as the basic generator system for Generative Programming – not only in our own internal product development, but also within important customer projects to create customer-specific tools.

The ANGIE generator system

ANGIE comprises a script language, a compiler and an associated runtime system. It is an expandable modular system for implementing software generators.

The frame technology that ANGIE is based on offers a simple and fast way of developing manageable generators while concentrating entirely on the core task of semantics.

ANGIE is designed to optimize expandability and integrability, and is now the technical basis for several tools and products, including the tool Pattern By Example (PBE).

Pattern By Example

With PBE, you can implement your own patterns instead of re-applying them “manually” as theoretical concepts.

Existing code artifacts, which one would otherwise copy and manually modify – frequently making errors in the process – can be used as the basis. In other words, PBE technically supports an intuitive process, partly automating it and eliminating its deficiencies.

PBE can produce entire libraries of code patterns, which themselves act as modules for the mappings derived from a generative domain model. These are all generativetasks.

Current trends

We’ve seen that the ANGIE generator system handles the technical aspects of implementing generators; however, there is a serious need for appropriate tools to design system families, up to and including the parameterization of generators.

There are already GP concepts for these tasks: system families are modeled and specified using techniques such as domain engineering, feature modeling and domain-specific languages (DSLs).

Now it’s time for these concepts to be realized in practical tools. To this end, Delta Software Technology is working closely together with the University of Applied Sciences in Kaiserslautern (see Partners).

It’s partly about having support for the modeling process for system families, e.g. by editors for feature models. And it’s also about generators being parameterized using DSLs; you can automatically generate some of the required specifications and components as long as you have an appropriate standardization.

In this area there are many new trends based on open standards being created by the OMG (Object Management Group). Since Delta Software Technology is a member of the OMG, this is a strategic theme for us.