Checking for pattern errors
Before you begin
About this task
Before you test a pattern, you can add debug messages to the hot spots to trace the process sequence for expansion and update methods. Trace messages are displayed in the developer workbench Console view.
If you included breakpoints in your pattern code; they are listed and controlled in the Breakpoint view in the developer workbench. You can resume pattern processing after a reaching a breakpoint by clicking
.For details on applying patterns, refer to the topics on applying patterns. As every pattern is unique, there is no single method to test patterns. The following instructions are options to modify the pattern. Parameters with dependencies invoke multiple methods for each command when a change occurs to a supplier parameter.
Procedure
To test your pattern, do one or more of the following
steps:
- Add an argument to each template parameter by using the Apply pattern wizard or drag and drop gestures. The expansion method that handles added values are invoked.
- Delete each argument by using the Undo or Delete from Model menu items. The expansion method that handles removed values is invoked.
- Replace an argument with another. This action invokes an method for handling removed values and then a method for handling added values.
- Reapply the pattern to reevaluate all arguments bound to the pattern instance. Reapplying a pattern updates any arguments that were bound and then modified outside of the pattern.
- Unapply the pattern to invoke a remove of all arguments. This action removes the pattern.
- Unbind a single argument to invoke a remove method. The expansion method for handling removed values is invoked.