Forward Engineering & the Development Process

iQgen follows a strict forward engineering approach, as opposed to other well known strategies such as reverse engineering or round-trip engineering. What this means for you is that you need to be careful to make any changes in the appropriate place - either in the model or inside the protected areas in your generated artifacts. A failure to do so will result in your code being overwritten unintentionally, resulting in code loss. To address this, your development process should be adjusted to match the generative approach to software development.

It's tempting to view this as a disadvantage, and require that every artifact in the system should be modifiable with whatever tool is best suited to the purpose. But the generation of multiple artifacts from a simpler, central source element raises productivity so much that you will soon get used to it and appreciate the benefits. An obvious analogy to the classical compile step can be made, and after all, you would not expect to be able to modify the machine (or VM) code emitted by a language compiler.

Embedding Code Generation in your Development Cycle

The first step to take when introducing a generative approach is to embed the code generation process into your processing chain. In general, this means that you should generate code from within your build scripts. The iQgen Ant integration allows you to call iQgen from within your Ant scripts. If you prefer make or some other build management tool, you can use the command line tools.

As with other software artifacts, you should take care to put your source model under configuration management control. Depending on your CASE tool of choice, you can either version the model file itself or only the XMI export. While the first choice is preferable, some tools don't offer this possibility - most notably those that are based on some centralized repository. They do, however, usually offer some built-in versioning mechanism instead.

As a result, your build cycle will roughly resemble the following process:

  • Generate code from the XMI model file

  • Compile the source code

  • Link and build your deployment units

  • Deploy to your test environment

  • Test and repeat

Generating Code in regular automated Builds

It is a recommended best practice to set up a periodic, automated build process that runs centrally to minimize integration problems. When using a generative development process, you should make sure that your centralized build includes the code generation step. This is the best way to make sure that no code that has been manually added outside the protected areas becomes part of the system.