- Introduce Foreign Method
Create a method in the client class with an instance of the server class as its first argument. - Introduce Local Extension
Create a new class that contains these extra methods. Make this extension class a subclass or a wrapper of the original.
Organizing Data: - Replace Data Value with Object
Turn the data item into an object - during initial stages of development, your data is simple. As development proceeds you realize that those simple items aren't so simple anymore - turn it into an object. - Duplicate Observed Data
You have domain data available only in a GUI control, and domain methods need access - Copy the data to a domain object. Set up an observer to synchronize the two pieces of data. - Change unidirectional Association to Bidirectional
You have two classes that need to use each other's features, but there is only a one-way link - Add back pointers, and change modifiers to update both sets. - Replace Magic Number with Symbolic Constant
Monday, September 29, 2008
Refactoring (Part 2)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment