Pattern code and support files

A Java-based pattern framework is provided to facilitate pattern design and implementation. The framework supports a set of mechanisms for default pattern behavior and a set of extensions for specific pattern implementation.

This basic code is known as the implementation model and includes a pattern library, the pattern body, and pattern parameters. The framework also provides commonly used functions for the author to use by extending the interfaces and abstract classes defined in a pattern service. The basic default code is added when the pattern author creates the pattern plug-in project. The pattern library, essential to pattern design, is created during this process.

The author completes the implementation model by adding one or more patterns and their template parameters to the library. This is accomplished by using GUI-based tools. The implementation model is regenerated each time the pattern author modifies the library model. Patterns are represented by Java™ classes and nested within these classes is a class for each parameter. Each parameter has empty expansion methods to address the addition or removal of an argument.

Dependencies are used to control the expansion sequence when one parameter requires the values of another to expand. A dependency class is nested in the appropriate parameter class and includes three update methods. Code added to the update methods addresses conditions that may occur in pattern application: adding, removing, or maintaining an argument.

The expansion and update methods are known as hot spots. The pattern author supplies the appropriate code in the hot spots that will invoke the required behaviors when the pattern is applied. Hot spots are clearly annotated in the default Java code with TODO comments. The default code is marked with Javadoc @generated tags. The @generated tags must be removed if the default code is modified or the modifications are overwritten when the implementation model is regenerated.

Related tasks
Defining expansion methods
Defining update methods
Adding dependencies to parameters
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.