2.6. How to use features

To use different features we have implemented following structure: see Figure 2.2, “Model of the feature structure” .

Figure 2.2. Model of the feature structure

Model of the feature structure

In fact features are divided into 2 to 3 groups. The main groups are PreFeature and PostFeature . PreFeatures do something before the generation, so for example they prepare the PostFeatures. PostFeatures do something after the generation, but maybe they need preparation before they can do something.

The 3rd group is the PostProcessor . PostProcessors are doing stuff after generation of one file and before the file is written and closed (they can also do stuff with the file after the file is written). Maybe they also need preparation. The difference between PostFeatures and PostProcessors is that PostFeatures are used after all files are written and PostProcessors are used after one file is generated instead.

In Figure 2.3, “Activity diagram of the generation process in correlation with the features ” you can see how the features are invoked during the generation process.

Figure 2.3. Activity diagram of the generation process in correlation with the features

Activity diagram of the generation process in correlation with the features

All features from the 3 groups can be added to the generator through the workflow file. The order of the groups is indifferent, but the order in the groups is important in the workflow file.

Note

- PreFeatures can be added with the beginning phrase preFeature .
- PostFeatures can be added with the beginning phrase postFeature .
- PostProcessors can be added with the beginning phrase postProcessor .

Every feature can be added with one of the following 3 structures: