4.1. Generator types
To accommodate different scenarios, OrmFactory supports three types of generators: XML, command-line, and Python script generators. When you create a new generator, you will be given a choice of which generator to add.
Below the python generator in the list are examples. Examples are requested from this site, so you need to have internet access to get them. Below the python generator in the list are examples. The examples are requested from this site, so you need to have the Internet to get them. For more information, see the article about our examples.
Xml generator
The xml generator can be used either to debug an external code generator, or in a chain of generators to prepare a data structure for the following generators. It prepares an xml file of the structure in the same format as the command line generator or python generator receives it.
Its difference is that the generated xml file will not be deleted after the generator call chain is completed.
Command line generator
This is a simple mechanism for calling an external program by passing the name of a temporary file as a parameter. The temporary file contains the project structure in xml format, similar to the xml generator.
This type of generator works with any programming language or internal tool.
Python script generator
This type of generator, like the previous one, also passes the generated project structure as a link to a temporary file. But unlike the previous one, it launches the Python interpreter with your script.
Attention! For this mechanism to work, you must have Python installed and the paths specified.
You can use your favorite IDE to create and edit Python scripts. But for quick editing and debugging, OrmFactory has a simple editor built in. While not a full IDE, it functions more like a syntax-highlighted notepad, but it allows you to run a script with one button (F5
) and see debug messages sent by the script via print.
Note: scripts can only be executed from disk, so when you press F5
, the changes are first saved and only then launched.
For more information on how to work with the project structure, see the 4.3. Project structure section.