In designing the pattern, the pattern author creates a pattern project that includes a pattern library. Next, patterns are added to the library. The author can also supply static data or metadata, for example, to document the pattern, provide search keywords, or designate groups.
Adding parameters to patterns
A pattern usually has at least one parameter although this is not a requirement. Parameters define the targeted argument's UML 2.0 type and the acceptable multiplicity values. Each parameter is represented by a Java™ class and contains the code instructions to perform the work accomplished by pattern expansion.Assigning patterns to groups
Every pattern must be assigned to at least one group. A pattern is assigned to the default group Miscellaneous Patterns if the pattern author does not specify one.Adding dependencies to parameters
Dependency relationships are specified between two or more parameters in the same pattern by using the Pattern Authoring view. Parameter dependencies control pattern expansion when the pattern is applied.Setting pattern property values
The pattern author can set or modify the pattern property values for pattern libraries, patterns, and parameters by using the Properties view. Some properties are informational only and cannot be modified.Providing documentation for pattern appliers
The pattern applier requires pattern documentation to select an applicable pattern, to apply the pattern, and to project the results of the pattern application. Different types of documentation is generated or contributed by the pattern author to match the needs of the pattern applier.Renaming patterns and parameters
After you add patterns and parameters to a library you can change their names to more accurately describe the pattern purpose or function. You rename patterns in the Pattern Authoring view.Regenerating source code
In designing the pattern, the Java™ code can get out of sync with the static data in the library or pattern manifest files and errors are reported in the Problem view. You can use the Regenerate Source Code menu item to restore this implementation code.Regenerating pattern definitions
The content of the pattern manifest (.rmd) files must remain in sync with the pattern definition. If an error occurs, you can resynchronize the manifest with the pattern definition by using the Regenerate Definition Template menu item.
Parent topic: Defining patterns
Related concepts
IBM Rational design patterns