Generating based on domain model

This model handled the code generation based on the domain model.

Templates are provided for the following aspects.

  • ejb3 : EJB3 persistence layer
  • t5gui : tapestry5 user interface
  • login : user management support
  • docs : domain model documentation

Domain model processing

The domain model is parsed using xstream and then enriched in a couple of steps.

  • Handling of includes. The xml files are parsed one by one. And extra steps are need to include the files which are referenced in the model.
  • Enriching the model, this includes things like building the root tables which flatten the inheritance tree.
  • Validation of constraints on the domain model, catching the contradictions.

Developing the templates

For the development of the templates, it is recommmended that you first try to make the change in the generated sources and verify that your changes are valid first. This way, the compilation will not require regeneration of the files (as long as you don't clean and don't change the domain model).
When the changes work, you can then try to incorporate the modifications in the templates. At that point, you have to recompile the module with the templates and then do a clean build on your verification project (the clean build is needed because the changes in the templates are not noticed by the system).

When developing the templates, you can access the processed model. This model (the API of available methods) can be found in the "org.equanda.domain.xml" package.

Details about the structure of the templates.

  • 1. Generating based on domain model
  • 1.1. Domain model processing
  • 1.2. Developing the templates