Reclassifying the refactorings.

This is an attempt to re-classify Fowler's refactorings with respect to structure, identifying the structural element to which each refactoring primarily applies - these elements, in Java, being the method, class and package - and showing whether the refactoring creates (C) or destroys (D) elements, or merely transforms (T) element relationships without creating or destroying elements. These tables are discussed in the post here.

Refactoring Method Class Package
Extract Method C
Inline Method D
Inline Temp
Replace Temp with Query C
Introduce Explaining Variable
Split Temporary Variable
Remove Assignments
to Parameters
Replace Method with
Method Object
Substitute Algorithm

Table 1: Composing methods refactorings.

Refactoring Method Class Package
Move Method T
Move Field
Extract Class C
Inline Class D
Hide Delegate T
Remove Middle Man T
Introduce Foreign Method C
Introduce Local Extension C

Table 2: Moving features between objects.

Refactoring Method Class Package
Self Encapsulate Field C
Replace Data Value
with Object
Change Value to Reference
Change Reference to Value
Replace Array with Object C
Duplicate Observed Data C
Change Unidirectional Association
to Bidirectional
Change Bidirectional Association
to Unidirectional
Replace Magic Number
with Symbolic Constant
Pretend to be Dead
Encapsulate Field C
Encapsulate Collection C
Replace Record with
Data Class
Replace Type Code
with Class
Replace Type Code
with Subclasses
Replace Type Code
with State Strategy
Replace Subclass with Fields D

Table 3: Organizing data.

Refactoring Method Class Package
Decompose Conditional C
Consolidate Conditional C
Consoidate Duplicate
Conditional Fragments
Remove Control Flag
Replace Nested Conditional
with Guard Clauses
Replace Conditional with
Introduce Null Object C
Introduce Assertion

Table 4: Simplifying conditional expressions.

Refactoring Method Class Package
Rename Method
Add Parameter
Remove Parameter
Separate Query
from Modifier
Parameterize Method D
Replace Parameter with
Explicit Methods
Preserve Whole Object
Replace Parameter with Method
Introduce Parameter Object C
Remove Setting Method D
Hide Method
Replace Constructor with
Factory Method
Encapsulate Downcast
Replace Error Code
with Exception
Replace Exception with Test

Table 5: Making method calls simpler.

Refactoring Method Class Package
Pull up field
Pull Up Method T
Pull Up Constructor T
Push Down Method T
Push Down Field
Extract Subclass C
Extract Superclass C
Extract Interface T
Collapse Hierarchy D
Form Template Method T
Replace Inheritance
with Delegation
Replace Delegation
with Inheritance

Table 6: Dealing with generalization.