A number of code generation operations are supported by the browser.
These functions are reachable via the classList's, the variableListView's and the methodList's
"generate"-submenus.
One of the most useful code generator is the
Generate Application Code function,
which, after a new Application subclass has been defined, generates all code that is
required for an empty application window, a main menu and some initial template code.
Further application development from this initial code
is very easy using the Menu- and UIPainter tools.
Notice, that these code generators never overwrite existing code.
To re-generate a method, it is required to remove any existing method before.
- Class Menu - Generate:
- Variable Menu - Generate:
- Selector Menu - Generate:
Attribute Access
- Access Methods
- Generates getter/setters for the selected instance/class variable(s).
Similar to the corresponding
"Abstract Variable Refactoring",
but does not rewrite any code which accesses the variable(s).
- Getter Methods
- Generates getters for the selected instance/class variable(s).
- Setter Methods
- Generates setters for the selected instance/class variable(s).
- Multi Setter Method
- Generates a setter method for the selected instance/class variable(s).
This method expects multiple arguments and writes all instances variables (useful for initializers).
- Access Methods with Lazy Initialization
- Generates getter/setters for the selected instance/class variable(s).
The getter method performs lazy initialization of the intance variable
- Access Methods with Change Notification
- Generates getter/setters for the selected instance/class variable(s).
The setter method sends out a change notification to observers (i.e. dependents).
- Access Methods for ValueHolder
- Generates getter/setters for the selected instance/class variable(s).
The actual value is kept in a valueHolder.
- Access Methods for ValueHolder with Change Notification
- Like above. In addition, the setter sends out a change notification to observers (i.e. dependents)..
Common Patterns
- Update Method Template
- Generates an empty
#update:with:from:
method (Observer entry).
- Visitor Method
- Generates a visitor entry method (part of visitor pattern).
- Visitor and Visited Methods
- Generates both visitor and visited methods (full visitor pattern).
- Classtype Test Methods
- Generates
#isXXX
classType test methods in the selected class and all subclasses.
(like isString
.)
Class Code
- Documentation Stubs
- Generates empty documentation methods on the class-side.
- Application Code
- Generates initial window- and menu- specification methods and also dummy hooks for an application.
This menu item is enabled if the selected class is a subclass of ApplicationModel.
- Initialized Instance Creation
- Generates a dummy
#initialize
method and a #new
-method on the class side, which invokes this initializer.
- Corresponding Instance Creation
- Generates an instance creation method on the class side, named the same as the selected method,
which invokes the selected method.
- Sharedpool Initialization
- Generates code to initialize the pool's class-variables.
Framework Building / Filling
- Required Protocol
- Generates dummy methods for all those selectors which are declared as
#subclassResponsibility
in a
superclass. Useful to help in implementing the required protocol in a whiteBox framework.
- SubclassResponsibility in Superclass
- Generates a trapping
#subclassResponsibility
method in the superclass for the selected method's selector.
- SubclassResponsibility Here
- Generates a trapping
#subclassResponsibility
method.
- Templates in Subclasses
- Generates dummy template methods for the selected method's selector in all subclasses.
- Forwarding Method on Instance Side
- Generates an instance method, which forwards the selected message to the class side.
The forwarding method takes the same arguments as the selected class method.
(See also
"Move to Class with Forwarder",
found in the selector menu, which moves a method to another class with forwarding).
Next: A Warning
Copyright © 2000 eXept Software AG, all rights reserved
<info@exept.de>
Doc $Revision: 1.9 $ $Date: 2012/10/20 17:55:42 $