|
Template System Topic updated 20-6-2007 |
|
The GenWise Template System introduces a unique, powerful programming paradigm. Source code generation is performed by collections of specialized templates that are hierarchically organized. All templates interact and cooperate, each having their specific generation tasks. When generating software with GenWise, program functionality is determined by the following activities:
The GenWise approach shifts development efforts from editing source code files (whether created from scratch or with traditional code generators) to working with templates, configuring them and enhancing their output.
Template format GenWise Templates are .NET classes in assemblies loaded by GenWise Studio. GenWise Templates are registered into GenWise Studio using the Template Factory. The plug-in structure makes the GenWise Template System extendable.
Hierarchical structure Templates are organized in a hierarchical way and delegate generation tasks along this hierarchy. A complete hierarchically organized set of templates is called a Template Chain. At the top of the hierarchy in Template Chains are Project Templates.
Template interaction There are different Template Types working together in every GenWise project. Some templates work on the level of single project items. Other templates interact with multiple project items, adding functionality by changing their source code generation behaviour. A good example of this are Extension Templates.
Template Options Main project items have Template Options Pages that give access to their own template options and of their child templates. Every template defines a set of template options to configure its source code generation behaviour. Source code gets conditionally generated depending on template options, preventing generation of unnecessary code, and tailoring the application to its tasks.
Global template configuration A strong feature of the GenWise Template System is its distinction between Global Template Configuration and template instance configuration. Every instance of a certain template uses globally set template option values, unless these are overruled at the instance level. As a result, you can control many aspects of the generation process in centralized way, while having detailed control over single cases where needed. Most templates define a large part of their template options as globally configurable within the project. In the Global Template Configuration screen you can view and edit all global template options within the project.
Example of Template Options
When the mouse is moved over a template option the Options Help pane displays a short explanation for it. Notice that colors are used to communicate the status of individual template options. At the bottom there is a legend that helps you to remember the meanings of the colors when the mouse is moved over them. The colors convey status information as listed below.
|