반응형

HTTPS://WWW.REFACTORING.COM/CATALOG/

 

Refactoring Catalog

 

COMPOSING METHOD

•  Extract Method
•  Inline Method
•  Inline Temp
•  Replace Temp with Query
• Introduce Explaining Variable
•  Split Temporary Variable

• Remove Assignments to Parameters
• Replace Method with Method Object

 

MOVING FEATURES BETWEEN OBJECTS

•  Move Method
•  Move Field
•  Extract Class
•  Inline Class
•  Hide Delegate
•  Remove Middleman
• Introduce Foreign Method
• Introduce Local Extension

 

ORGANIZING DATA

•  Self Encapsulate Field
•  Replace Data Value with Object
•  Change Value to Reference
•  Change Reference to Value
•  Replace Array with Object
•  Duplicate Observed Data
• Change Unidirectional Association to Bidirectional
• Change Bidirectional Association to Unidirectiona
• Replace Magic Number with Symbolic Constant
•  Encapsulate Field
•  Encapsulate Collection
•  Replace Record with Data Class
•  Replace Type Code with class
•  Replace Type Code with Subclasses
•  Replace Type Code with State/Strategy
•  Replace Subclass with Field

 

SIMPLIFYING CONDITIONAL EXPRESSIONS
•  Decompose Conditional
•  Consolidate Conditional Expression
•  Consolidate Duplicate Conditional Fragments
•  Remove Control Flag
•  Replace Nested Conditional with Guard Clauses
•  Replace Conditional with Polymorphism
•  Introduce Null Object
•  Introduce Assertion

 

 

MAKING METHOD CALL SIMPLER
•  Rename Method
•  Add Parameter
•  Remove Parameter
•  Separate Query from Modifier
•  Parameterize Method
•  Replace Parameter with Explicit Method
•  Preserve Whole Object
•  Replace Parameter with Method 

•  Introduce Parameter Object
•  Remove Setting Method
•  Hide Method
•  Replace Constructor with Factory Method
•  Encapsulate Downcast
•  Replace Error Code with Exception
•  Replace Exception with Test

 

 

DEALING WITH GENERALIZATION

•  Pull up Field
•  Pull up Method
• Pull up Constructor Body
•  Push down Method
•  Push down Field
•  Extract Subclass
•  Extract Superclass
•  Extract Interface

▪ Collapse Hierarchy
▪ Form Template Method
▪ Replace Inheritance with Delegation
▪ Replace Delegation with Inheritance

반응형