A GeneXus Generator generates code in a programming language.
For each Environment you create in your Knowledge Base, you have to select:
- One GeneXus Generator to generate the code corresponding to the application's Back end (it is automatically named "Default").
- One or more GeneXus Generators to generate the code corresponding to the application's Front end.
Later, in addition to having a "Default" Generator to generate the application's back-end code, eventually, you can add more Generators (usually known as "Secondary" Generators) to generate, for example, certain objects with Java and others, like some batch processes, in RPG).
The "Default" Generator is also used to generate the programs to create/modify the database structure (that is to say, the Reorganization programs).
The Preferences window shows, for each Environment, a Back end node and a Front end node with, among other things, their Generators. The symbol pointed out indicates the Reorganization Generator:
The Reorganization Generator can be changed (if needed). There are two ways to do it:
- By updating the Environment Reorganization Generator property value.
- By right-clicking on one of the Environment Generators and selecting the "Set As Reog Generator" option:
To add a Secondary Generator, right-click on the Back end node and select the "New Generator" option:
A Secondary Generator can be set as the Reorganization Generator of the Environment.
Moreover, for a Secondary Generator, you can change its language by clicking on it and selecting the "Change Generator" option:
The "Change Generator" option is not valid for the "Default" Generator. To change the "Default" Generator values you have to edit the Environment properties.
Finally, as mentioned above, it is possible to generate certain objects with a Generator and other objects with different Generators. To do so, each Main Object can be associated with a Generator (Default, Secondary, or Reorganization) that defines the target language to generate. The Generator property of each main object indicates the Generator with which GeneXus will build it and any object of its main call tree. Note that an object can be called by more than one main object, so it can be generated with different Generators.