坏味 | 常用重构 |
重复,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) |
发散式变化,p79 | Extract Class(149) |
依恋情结,p80 | Move Method(142),Move Field(146),Extract Method(110) |
霰弹式修改,p80 | Move 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) |
冗赘类,p83 | Inline Class(154),Collapse Hierarchy(344) |
平等继承体系,p83 | Move Method(142),Move Field(146) |
夸夸其谈未来性,p83 |
Collapse Hierarchy(344), Inline Class(154), Remove Parameter(277),Rename Method(273) |
过度耦合的消息链,p84 | Hide Delegate(157) |
令人迷惑的暂时字段,p84 | Extract Class(149),Introduce Null Object(260) |
异曲同工的类,p85 | Rename 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) |
过多的注释,p87 | Extract Method(110),Introduce Assertion(267) |
被拒绝的遗赠,p87 | Replace Inheritance with Delegation(352) |
转载于:https://www.cnblogs.com/yuanwangwu/archive/2012/05/03/2480461.html