Exercise 2: Importing sample patterns

This exercise imports the sample patterns. The samples are imported to a pattern samples repository and not to your workspace. Patterns only appear in your workspace if you select and apply them.

You will select a sample pattern in this tutorial. After you complete this tutorial, you can get additional practice applying the other sample patterns. After import, the sample patterns remain listed in your Pattern Explorer view unless you choose to remove them.

Patterns are accessible in the Pattern Explorer view. You can use this tool to organize, select, and apply patterns. You can see the pattern samples immediately after you import them, if the Pattern Explorer view is open.

If you would like to view this exercise before you perform the steps, click:

Show me button Show Me

Before you begin, you must have created the UML project as detailed in Exercise 1: Creating the model environment.

Opening the Pattern Explorer view

You can apply any patterns that are listed in the Pattern Explorer view. If the Pattern Explorer is already open, skip this step.
  1. Click the Pattern Explorer button that appears in the bottom or right-hand Workbench frame to open the Pattern Explorer view. The Pattern Explorer view opens with a group of advanced patterns already installed: Design Patterns.
  2. Click the Pattern Explorer button again or click anywhere outside the Pattern Explorer view. The Pattern Explorer view disappears.
  3. Repeat step one to open the Pattern Explorer view. Thus, you can quickly switch views and you may want to do this while you apply patterns.
If you do not see the Pattern Explorer button, then the Modeling perspective is not in focus. Return to exercise one to open the Modeling perspective, Exercise 1: Creating the model environment.

Importing the pattern samples

You can import the samples now and you will see them appear in the Pattern Explorer view.
  1. Check the Pattern Explorer view to see if the sample patterns group, Sample Patterns, has already been imported. If they are imported, skip the following import instructions but do read the instructions for general knowledge about the samples.
  2. Open the Samples Gallery page by clicking: Samples Gallery. The Samples Gallery page opens.
  3. Expand the Technology samples, expand Patterns, and click Patterns samples.
  4. At the bottom of the Patterns sample page, click Import the sample patterns. The Sample Model window opens.
  5. Accept the default project name and click Finish. The samples group, named Sample Patterns, appears in the Pattern Explorer view.
  6. Expand Sample Patterns to see the subgroups organized into folders. Each folder represents a pattern.
In summary, Sample Patterns is a group of pattern samples that you can use to practice applying patterns. You cannot apply a pattern from the Model Explorer view but the Model Explorer view is important to applying patterns as you will see in the next exercises.

Now you are ready to begin Exercise 3: Selecting the pattern.

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.