代码坏味

 
坏味常用重构
重复,p76

Extract Method(110),Extract Class(149),

Pull Up Method(322),,Form Template Method(345)

过长函数,p76

Extract Method(110),Replace Temp With Query(120),

Replace Method with Method Object(135),

Decompose Conditional(238)

过大的类,p78

Extract Class(149),Extract Subclass(330),

Extract Interface(341),

Replace Data with Object(175)

过长的参数列,p78  

Replace Parameter with Method(292),

Introduce Parameter Object(295),

Preserve Whole Object(288)

发散式变化,p79Extract Class(149)
依恋情结,p80Move Method(142),Move Field(146),Extract Method(110)
霰弹式修改,p80Move Method(142),MoveField(146),Inline Class(154)
数据泥团,p81

Extract Class(149),Introduce Parameter Object(295),

Preserve Whole Object(288)

基本类型偏执,p81

Replace 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),

Replace Type Code withd State/Strategy(227)

 

Switch 惊悚现身,p82

Replace Conditional with Polymporhpism(255),Replace Type Code

with Subclasses(223),Replace Type Code with State/Strategy(227),

Replace Parameter with Explicit Methods(285),Introduce Null Object(260)

冗赘类,p83Inline Class(154),Collapse Hierarchy(344)
平等继承体系,p83Move Method(142),Move Field(146)
夸夸其谈未来性,p83

Collapse Hierarchy(344), Inline Class(154),

Remove Parameter(277),Rename Method(273)

过度耦合的消息链,p84Hide Delegate(157)
令人迷惑的暂时字段,p84Extract Class(149),Introduce Null Object(260)
异曲同工的类,p85Rename Method(273),Move Method(142)
狎昵关系,p85

Move Method(142),Move Field(146),Change Bidirectional 

Association to Unidirectional(200),Replace Inheritance with Delegation

(352),Hide Delegate(157)

中间人,p85

Remove Middle Man(160),Inline Method(117),

Replace Delegation with Inheritance(355)

纯稚的数据类,p86

Move Method(142),Encapsulate Field(206),

Encapsulate Collection(208)

不完美的库类,p86

Introduce Foreign Method(162),

Introduce Local Extenstion(64)

过多的注释,p87Extract Method(110),Introduce Assertion(267)
被拒绝的遗赠,p87Replace Inheritance with Delegation(352)

转载于:https://www.cnblogs.com/yuanwangwu/archive/2012/05/03/2480461.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值