Associating UML profiles to pattern libraries
You can associate a UML profile with a pattern, and then
choose a UML profile stereotype or UML profile-contained enumeration
as the type for a specific pattern parameter. As a pattern author,
you can use stereotypes to further constrain the types of elements
that can bind to a parameter when a pattern is applied. You can associate
multiple UML profiles with one pattern library.
Before you begin
When you apply a pattern, bindings occur only from the set of stereotyped arguments to parameters that declare the type as such. During application, you can request the creation of a default argument for a pattern parameter type of a UML profile stereotype or UML profile-contained enumeration, which creates a new model element with the appropriate stereotype applied. When the pattern is applied, the instantiation of a pattern that is associated with a UML profile applies that particular UML profile to the target model. If the UML profile is not available, the instantiation does not occur and a message is displayed.
Procedure
- Click .
- In the New Project wizard, select the Show All Wizards check box, expand Pattern authoring, click Pattern Library, and click Next.
- In the New Plug-in Project window, on the Plug-in Project page, type a project name and click Next.
- On the Plug-in Content page, accept the default values, and click Next.
- On the Templates page, select the Create a plug-in using one of the templates check box, and from the list of available templates, select Plug-in with Patterns, and click Next.
- In the New Pattern Authoring Plug-in Project window, on the Pattern Library page, from the Patterns Framework list, select Generalized UML Patterns Framework.
- Beside the Optionally associate one or more UML profiles with this pattern library field, click Add.
- In the Select Profile window, select a profile to add from either the Deployed Profile list or from your workspace and click OK. The new UML profile that is associated with the pattern library appears in the Optionally associate one or more UML profiles with this pattern library field.
- Click Finish.