Adding dependencies to parameters

Dependency relationships are specified between two or more parameters in the same pattern by using the Pattern Authoring view. Parameter dependencies control pattern expansion when the pattern is applied.

When parameter dependencies are added, the framework inserts update methods known as hot spots into the class for the designated client parameter. The pattern author adds Java™ code to the update method to provide the behaviors for partial or delayed expansion based on the needs of the design.

You can add parameter dependencies when you do the following tasks:
  • Add a pattern and parameters by using the New Pattern wizard
  • Add parameters by using the New Pattern Parameter wizard
  • Add or edit parameter dependencies by using the Properties view

To add or edit parameter dependencies by using the Pattern Authoring view:

  1. In the Pattern Authoring, view right-click the parameter and click Show Properties View The Properties view opens.
  2. If you are assigning other parameters to the pattern as clients to the current parameter, do the following steps:
    1. In the Properties view, click the Client Parameters row and click the browse button to open the Edit Client Parameter Dependency window.
    2. Under Existing Parameters, click one or more parameters and click the right-arrow button to move them into the Client Parameters field.
    3. Click OK
    A set of update methods is added to the parameters that you assigned as client parameters. You add code to the update methods to specify the expansion behavior when the pattern is applied. This parameter must supply values to the client parameters before their partial or complete expansion can occur.
  3. If you are assigning other parameters in the pattern as suppliers to the current parameter, do the following steps:
    1. In the Properties view, click the Supplier Parameters value box and click the browse button to open the Supplier Parameter Dependency window.
    2. UnderExisting Parameters, click one or more parameters and click the right-arrow button to move the selected parameters into the Supplier Parameters field.
    3. Click OK
    A set of update methods is added to the parameter you were editing as it is now the client to your assigned supplier parameters. You add code to the update methods to specify the expansion behavior when the pattern is applied. This parameter requires values from the supplier parameters before partial or complete expansion can occur.
Related concepts
Pattern code and support files
Pattern expansion
IBM Rational design patterns
Related tasks
Creating pattern projects and libraries
Adding parameters to patterns
Assigning patterns to groups
Setting pattern property values
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.