The pattern author can add one or more patterns to the pattern
library. Each pattern is independent in function and application. However,
a pattern can only be distributed with its library in a pattern plug-in.
The New Pattern wizard enables you to define
the properties for the pattern and add all of its template parameters. After
the pattern is added to the library, you can modify the pattern's properties
and add, redefine, or remove its parameters. Many of the steps are optional,
you can create a simple pattern by accepting all of the defaults.
To
add a pattern and its parameters to the pattern library:
- In the Pattern Authoring view, right-click
the library node and click New Pattern. The General
page of theNew Pattern wizard opens.
- Define the basic pattern properties by doing the following steps:
- Type a name for the pattern in the Pattern Name field. This is the name that will be listed in the Pattern Explorer view to
identify the pattern.
- Accept the generated class and package names as generated from
the pattern name or modify them in the Class Name and
the Package fields.
- Select the type of pattern (class, collaboration, or package)
you are creating from the Pattern Type list.
- Click the Add button next to the Groups field
to open the Add group window and add group names to the
pattern. Patterns must be assigned to at least one group and can
be assigned to multiple groups. All patterns are listed in groups in the Pattern
Explorer view. The default group, Miscellaneous Patterns,
can be deleted.
- In the Version field, modify the version
number. The number must be in a xx.xx.xx
format where x is a number.
- Click the Detail tab to open the Details
page of the New Pattern wizard
- Type your name in the Author field.
- Type a brief pattern synopsis in the Short Description field. The short description appears on the Short Description page
of the Pattern Explorer view.
- Click the Add button next to the Keywords
field and add keywords for the pattern. Add keywords that a pattern
applier would use to find a match to your specific pattern. The metafiles
in the pattern are also searched for matches so you do not need to duplicate
any of the contents of such properties as descriptions or names.
- Add parameters by doing the following steps:
- Click the General tab to return to the General page
of the New Pattern wizard.
- Click the Add button next to the Parameters
field to display the General page of the Parameter
window. You can always add or modify parameters after
you finish using the wizard.
- Type a name for the parameter in the Name field. The Class Name is automatically derived
from the parameter name.
- Accept the generated (from the parameter name) class name or
modify it in the Class Name field.
- Type a short description of the parameter that can assist the
pattern applier to specify arguments for the pattern. The short
description appears on the Short Description page of
the Pattern Explorer view and as a tool tip when the
pattern applier hovers over the template parameter in the diagram editor.
- In the Type field, accept the UML 2.0
type of Class for the parameter's type or click Browse and
select another UML 2.0 type.
- If you are adding the pattern's first parameter or do not want
to add a parameter dependency, go to step i. To add a dependency, click the Parameter
Dependency tab.
- On the Parameter Dependency page, in the Existing
Parameters field, click one or more parameter names and then click
the move arrow buttons to position the parameter names in the Client
Parameters or the Supplier Parameters field. When you assign another parameter as a client or supplier parameter,
it dynamically adds the reciprocal assignment to the parameter you are adding.
Thus, moving an existing parameter into the Supplier Parameters field
assigns the role of client to the parameter you are adding.
- Click OK to return to the New
Pattern wizard.
- To add additional parameters, repeat steps b through h.
- Click OK to close the New Pattern wizard
complete the addition of the pattern.
The new pattern is added as a node to the pattern library in the Pattern
Authoring view the supporting RAS metafile for the pattern asset
and the Java™ classes for both the pattern and each parameter
are created.