Allows one pattern to act as a "one-off" of another pattern.
Patterns are collections of templates that reference one another by name through start and include tags. The overrides tag references another pattern and specifies that if a template in the pattern does not exist in the overriding pattern then the pattern specified on the overrides tag is searched for that template.
The overrides tag lets you build a pattern that reuses templates from another pattern. In this way, the behavior of the original pattern remains the same, while a modified variant of that behavior is available through a second pattern that overrides the original.
There are several common techniques that, taken together, make for a clean reuse of an original pattern's templates. First, by placing each of a pattern's templates in a directory with the same name as the pattern's pattern id, every pattern template has a unique name across all patterns. Second, by factoring out pattern behavior that is likely to change from development group to development group into templates providing just that behavior, you make it easier to override that behavior in another pattern.
When one pattern overrides another, the overriding pattern should have a control template named differently than the orignial pattern's control template. The overriding control template should use the override tag to identify the original pattern and then perform an include of the original control template. You should also include in the overriding pattern modified versions of templates whose behavior needs to overridden.
Tag Summary | |
---|---|
required |
<overrides pattern="value" /> |
full tag |
<overrides pattern="value" /> |
Required Attributes |
|
---|---|
pattern | The pattern id of the pattern to be overridden. The id can be found on the "SetID:" line of the overridden pattern's .pattern file |
There are no optional attributes |
---|
Example | |
---|---|
<overrides pattern="com.ibm.dptk.jdbc" /> This overrides tag indicates that this pattern is overriding behavior in pattern com.ibm.dptk.jdbc. Any templates in that other pattern whose behavior must change as part of the current pattern will be modified and placed in the current pattern. Any template not found in the current pattern while running include and start tags will be searched for in pattern com.ibm.dptk.jdbc |
© Copyright IBM Corporation 2000,
2006. All Rights Reserved.