To get some hands-on experience with iQgen we recommend to run the tutorial that comes with the iQgen distribution. You will find the templates in the directory samples/getting_started/tutorial_1/templates and the XML models in XMI format in directory samples/getting_started/tutorial_1/model.
The UML profile for Tutorial 1 is extremely simple - essentially, it doesn't use any stereotypes or tagged values at all.
Tutorial 1 uses the model depicted in the figure below. It will not result in a complete application, but in the end you will have source code which can be compiled and you will have obtained a deeper knowledge of how to develop templates.
To give you an overview of the templates in Tutorial 1, here's an overview table with some short comments.
Table 2.1. Files in Tutorial 1
| Directory | File | Comment |
|---|---|---|
| ./ | build.xml | Ant script for generation |
| model | Tutorial_1.xml | XMI v1.0 model file |
| model | Tutorial_1.mdl | Rational Rose model file |
| templates | main.jsp | Model element to template mapping |
| templates | interface.jsp | Simple example that demonstrates how to generate a Java interface |
| templates | class.jsp | More complex example that generates Java class files. Uses other templates like associations, attributes, and operations |
| templates | attributes.jsp | Used by class.jsp. Generates attribute declarations, getter and setter methods. |
| templates | operations.jsp | Used by class.jsp. Generates methods. |
| templates | associations.jsp | Used by class.jsp |
| templates | build.jsp | PostProcessTemplates example |
| templates | copyright.jsp | Copyright text |
| templates | drop_and_create.jsp | Simple SQL script |
| templates | params.jsp | Utility JSP that is included by other templates. |
| templates | utilities.jsp | Utility JSP that is included by other templates. |