Smalltalk User Guide : Making your own applications : Extending defined classes : Example: Adding the method needsMoreWork to your class extension
Example: Adding the method needsMoreWork to your class extension
Suppose you want to add a method to the extension of class Object. The method you add in this example contains no variables or statements. This method is meant to be placed in other methods simply as a marker that additional work needs to be done at that location. Once in place, you can then browse all senders of this method in the Smalltalk development environment to find methods that require more attention.
Tips
Another way to flag unfinished methods is to group them in a category named, for instance, Needs more work.
From the Application Browser you have open on DevelopChooser, add the method to your class extension as follows:
1. From the list of classes (upper left pane), select Object.
2. Verify that the settings in the browser are for viewing public instance methods.
3. Add the method category Guide Examples. (Select Add from the Categories menu. Then, in the displayed prompter, enter Guide examples.)
4. From the Methods menu, select New Method Template.
5. Revise the displayed template so it includes the following:
needsMoreWork
"This method is a marker that identifies code that
needs to be revisited for additional work."
6. Save the method. The method name needsMoreWork is displayed in the list of methods.
Method
7. From an Application Manager, create a version of your class extension and then release it.
In this example, your class extension was already an edition. If it had been a version the system would have automatically created an edition of it when you added a method. (Provided, of course, that the class is in an open application edition, and you have group privileges within it.)
Last modified date: 05/19/2020