Refactoring Techniques

Extract method – Turn the code fragment into a method whose name explains the purpose of the method.

Extract class – Create a new class and move the relevant fields and methods from the old class into the new class.

Extract subclass – Create a subclass for a specific subset of features.

Move method – Create a new method with a similar body in the class it uses most. Either turn the old method into a simple delegation, or remove it altogether.

Move field – Create a new field in the target class, and change all its users.

Introduce parameter object – Replace group of parameters that naturally go together with an object.

Preserve whole object – Instead of getting several values from an object and passing these values as parameters in a method call, the whole object should be send.

Hide delegate – If a client is calling a delegate class of an object, methods on the server should be created instead to hide the delegate.