User's Guide

Categorizing methods

The development environment allows you to categorize methods. You can use method categories to organize the list of methods defined by a class. For example, VisualAge uses category names that identify which application the method comes from. Also, category names in VisualAge end with either API or Internal. You are free to use and package any methods categorized as API. Methods categorized as Internal, however, are not part of the official Application Programming Interface for that object.

You or your team might want to develop a strategy for categorization. For example, a categorization scheme might include categories such as Accessing, Printing, Testing, and User Interface. It is also possible not to use categories at all.

Let's categorize the method you just added to the class String:

  1. In the Applications Browser, select the class String. Ensure that the browser is set to instance methods.
  2. From the Categories menu, select Add.
  3. In the pop-up menu, type STUG-Examples; then select OK. This category will explain that the method comes from the examples in this guide.
  4. Select the method convertToNumber.
  5. From the Methods menu, select Categorize > Add To Categories.
  6. Select STUG-Examples; then select OK. The method is now categorized.

When you categorize methods, it is possible to select more than one category for a given method.

Categorize the methods in STCalculator as follows:

  1. Select the class STCalculator.
  2. Add the category STUG-Examples as in steps 2 and 3 above.
  3. Select all of the methods by dragging the mouse across them.
  4. Categorize them all at the same time as in steps 5 and 6 above.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]