Creating a new pattern

When you use the "Apply Pattern" action against an application definition file (.appdef), the pattern toolkit will search for patterns that can be applied. One of the places searched is the Eclipse workspace since projects can contain templates. You use one or more projects to hold templates if you are developing a new pattern or if you are modifying an existing pattern.

Before the files in a project are treated as a pattern by the generator, you must first identify that project as being a pattern project. One way to do this is to create the project using the new pattern project wizard.

Click on File -> New -> Project and select the Design Pattern toolkit category. Selecting the New Pattern Project and clicking next will take you into the new pattern project wizard. The first page is the standard new project page. The second page lets you provide required pattern metadata:

Display Label This is the short label that will appear in a selection dialog when the users wants to apply a pattern to an application definition file and there is more than one available pattern.
Unique Template Set ID This is a unique name to be used internally by the generator and by other pattern developers who want to extend (override) your pattern. It is recommended that you use a unique java package-type name as a prefix and add an addition level or two of descriptive names.
High-Level Controller This is the name of the one template that will be applied to the application definition by the generator. It is assumed that this template will use the start template tag to apply the application definition to other templates in the pattern in order to generate the output artifacts for the pattern. Any text output generated directly by this high level template will not be saved.
Version The version id of this pattern.

These four attributes will be stored in a project file named .pattern. You may change these values by directly editing this file.


© Copyright IBM Corporation 2000, 2005. All Rights Reserved.