The template management system should be extensible. In other words the template system should allow the user to create new templates and add them to the code generation processing. It is easy to see that a user can have two or more templates that handle the same domain type. For example the user may have templates that generate persistence code for JDBC, EJB, JPA, etc. The user may not want all of the templates to be executed for all projects, so each UML project should allow the user to specify the templates that should be executed during code generation.
Example A class model element may be tagged as a persistence object. A persistence type is a domain type that means different things in different domains. Some example domains would be JDBC, EJB, JPA, etc. The template that is used to generate code would determine the type of persistence logic that is generated.
The user should also be able to specify the conditions in which a template can be executed. In the above example, the persistence templates would only be executed if a class model element has the "persistence" stereotype.