首页 > 代码库 > 重构:坏味道

重构:坏味道

坏味道(smell常用的重构手法(Common Refactoring
Alternative Classes with
Different Interfaces
,
p85
Rename Method (273), Move Method (142)
Comments, p87Extract Method (110), Introduce Assertion (267)
Data Class, p86Move Method (142), Encapsulate Field (206),
Encapsulate Collection (208)
Data Clumps, p81Extract Class (149), Introduce Parameter Object (295),
Preserve Whole Object (288)
Divergent Change, p79Extract Class (149)
Duplicated Code, p76Extract Method (110), Extract Class (149),
Pull Up Method (322), Form Template Method (345)
Feature Envy, p80Move Method (142), Move Field (146), Extract Method(110)
Inappropriate Intimacy,
p85
Move Method (142), Move Field (146), Change Bidirectional
Association to Unidirectional
(200), Replace Inheritance
with Delegation
(352), Hide Delegate (157)
Incomplete Library
Class
, p86
Introduce Foreign Method (162),
Introduce Local Extension (164)
Large Class, p78Extract Class (149), Extract Subclass (330), Extract
Interface
(341), Replace Data Value with Object (175)
Lazy Class, p83Inline Class (154), Collapse Hierarchy (344)
Long Method, p76Extract Method (110), Replace Temp With Query (120),
Replace Method with Method Object (135),
Decompose Conditional (238)
Long Parameter List,
p78
Replace Parameter with Method (292), Introduce
Parameter Object
(295), Preserve Whole Object (288)
Message Chains, p84Hide Delegate (157)
Middle Man, p85Remove Middle Man (160), Inline Method (117),
Replace Delegation with Inheritance (355)
Parallel Inheritance
Hierarchies
, p83
Move Method (142), Move Field (146)
Primitive Obsession, p81Replace Data Value with Object (175), Extract Class (149),
Introduce Parameter Object (295), Replace Array with
Object
(186), Replace Type Code with Class (218),
Replace Type Code with Subclasses (223)
Refused Bequest, p87Replace Inheritance with Delegation (352)
Shotgun Surgery, p80Move Method (142), Move Field (146), Inline Class (154)
Speculative Generality,
p83
Collapse Hierarchy (344), Inline Class (154),
Remove Parameter (277), Rename Method (273)
Switch Statements, p82Replace Conditional with Polymorphism (255), Replace
Type Code with Subclasses
(223), Replace Type Code
with State/Strategy
(227), Replace Parameter with Explicit Methods (285)
Temporary Field, p84Extract Class (149), Introduce Null Object (260)
  

 

 

 

 

重构:坏味道