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, VA Smalltalk uses category names that identify which application the method comes from. Also, category names in VA Smalltalk 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. This time when you select Add from the Categories menu, you will see a list dialog including STUG-Examples. Choose this category then select OK
3. Select all of the uncategorized methods by dragging the mouse across them.
4. Categorize them all at the same time as in steps 5 and 6 above. All the uncategorized methods are now categorized.
Last modified date: 06/27/2019