Genesys Code Generation Framework

Once the model of a jABC application is fully designed and the SIBs are all implemented, it is ready for deployment. The Genesys generation framework supports the user in transforming the model into an executable and deployable piece of code in a desired programming language. The library’s philosophy is not to be an “all-in-one device suitable for every purpose”, but rather to provide highly specialized code generators for different target formats like Java, C#, BPEL, etc.

Genesys is divided into three essential parts: the generation library, the jABC plugin and the developer tools. The generation library contains all available code generators as compiled java classes as well as their corresponding jABC models. Furthermore, the library provides a set of SIBs that can be (and actually is) used to model code generators with the jABC. The Genesys jABC plugin provides inspectors and dialogs for using and creating code generators within jABC. Finally, the developer tools provide utilities for users that wish to build custom code generators, such as a benchmark framework or an editor for VTL templates.

Genesys Architecture Overview

Genesys Development Process

The construction and evolution of the code generation library is based on the application of Lightweight Process Coordination. No generator of the library is programmed by hand: they have been all modeled with jABC. This way the generators can be easily verified using GEAR, thus assuring a certain quality of the generation process and adding indirect trustability of the generated code. Furthermore, developers of new generators immediately benefit from already implemented generators by reusing SIBs as well as whole (sub-)models.

As currently most of the generators in the library are template-based, the easiest way to build a new generator often is to simply modify the templates of an existing generator accordingly. For example, we obtained a generator for Java Servlets from an already implemented generator for Java classes (with a main method). The latter was the first generator which was modelled as a jABC model. We then bootstrapped this generator by executing the model with the jABC Tracer, i.e. essentially that this first generator generated itself. Afterwards, we obtained a code generator for Java Servlets by only slightly modifying the model of the generator for Java classes, and finally generated it using the generator for Java classes.

Genesys Development Process