Reapplying patterns

You can reapply a pattern to invoke the pattern expansion code for all bound arguments. Reapplying the pattern examines all of the argument values and their dependencies on each other. Reapplying the pattern may be necessary if you modify a model element that has been used as an argument to a pattern.

About this task

For example, applying the Delegation pattern results in the following relationships between an interface and a class:

Delegation pattern with bound arguments that a dependency and an association relationship.

Adding an operation to the interface element does not affect the class. However, reapplying the pattern causes it to re-evaluate the parameters and the operation is added to the class.

Results of the reapply of a Delegate pattern to show the distributed operation.

This command must be performed on the pattern instance in the diagram view.

Procedure

To reapply a pattern to all bound elements, in the diagram editor, right-click the pattern instance and click Patterns > Reapply Pattern.

Feedback