Creating rules for architectural control

You can create a rule to alert you if extraneous dependencies are introduced into your application's code. The New Code Review Rule wizard provides templates for architectural control rules that you can customize for your application. You make rules unique by specifying properties for them.

To create an architectural control rule:
  1. Click Window > Show View > Other, expand Java, select Code Review, and click OK. The Code Review view opens.
  2. Click Window > Preferences. The Preferences window opens, showing the Code Review page.
  3. In the left pane, expand Java, then select Code Review.
  4. In the Preferences window, click New rule. The New Code Review Rule wizard opens.
  5. In the Select rule template list, under Architectural Control, click the template you want to use for your rule. When you select a template, the text below the list provides information about the rule you create from it.
  6. Click Next.
  7. In the Configure window, under Basic properties, specify the following information:
    • Category: Accept the default category, Structural Analysis, to which the rule is assigned.
    • Severity Level: Click Problem, Warning, or Recommendation to indicate how strictly you want to enforce the rule.
  8. Under Specific properties, specify the properties that are dependent upon the template you chose. These properties are unique to your rule, such as a file or class in your own application.
  9. Click Finish to return to the Preferences window, where you see that your rule has been added to the Structural Analysis code review.
Note: You can run the Structural Analysis code review on the workspace, a working set, or a project. However, if you run it on a single file, no results are displayed.
Related concepts
Architectural control rules
Structural analysis
Related reference
Structural Analysis code review
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.