重构:坏味道

坏味道(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)
  

 

 

 

 

转载于:https://www.cnblogs.com/kakafra/p/4122324.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值