< Previous | Next >

Lesson 7: Reapply the pattern

The lesson explores reapplying the sample pattern after adding additional elements to an interface you will use as an argument.

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

In lesson 6, you specified arguments for the Interface pattern. You saw that UML operations were added to the class AppFunction1 when you specified AppFunction1 as an argument, and it was bound to the assigned template parameter. Now you can modify some of the argument elements to observe how you can use reapplying patterns to update the other elements that participated in the pattern application.

So that you can see the power of using pattern, add an operation element to observe the results of reapplying the pattern. To add an operation to an interface:

  1. In the Project Explorer view, right-click the IMyInterface interface and click Add UML > Operation . An operation is added to the interface and the default name is in focus.
  2. Type myOperation over the default name.
  3. In the diagram view, right-click the pattern instance and click Patterns > Reapply Pattern . Unless the pattern author specifically alters the reapply process in a pattern's design, all of the bound elements, as with this pattern, are now re evaluated by the pattern.
  4. In the diagram view or in the Project Explorer view, locate the AppFunction1 class to observe the results of the reapplication of the pattern. The myOperation operation was added to IMyInterface.
Finish this tutorial by reviewing the materials in the Apply a pattern summary.
< Previous | Next >

Feedback