Chapter 1 - Introduction

Poseidon for UML uses an implementation of the the Velocity Template Language for code generation. Velocity was developed as part of the Apache project to enable data formatting and presentation, for example in dynamic Web pages (see http://jakarta.apache.org/velocity). Poseidon takes this template-based approach one step further, applying it to a broader range of code generation.

  1. Preparation: Velocity is fed with the model information, and
  2. Generation: The files are generated by Velocity on the basis of the model and template information.

In the preparation stage, the context for Velocity's code generation is filled by Poseidon. This context contains information about all the model elements relevant for the code, as well as any model elements needed to complete the set of data. Poseidon has to set up the generation environment in this step (for example, the used template files) and has to hand over to the context the objects that contain the data for generation (class names, operations, method bodies, etc.).

In the generation stage, Velocity generates the files for every relevant item in the model, using the specified template and the context data provided in the Preparation stage.

Code generation based on the standard Java and HTML templates is possible in all editions of Poseidon for UML, including the Community and Standard Editions. With the Developer Edition, it is possible to modify and extend the code generation framework. The following sections describe the components of the code generation framework and how they can be modified.



© 2000 - 2010 Gentleware AG
         
                        
 support  documentation  documentation