?重构(Refactoring):在不改变软件的功能和外部可见性的情况下,为了改善软件的结构,提高清晰性、可扩展性和可重用性而对软件进行的改造,对代码内部的结构进行优化。
(1)Duplicated Code(重复的代码)
(2)Long Method(过长函数)
(3)Large Class(过大类)
(4)Long Parameter List(过长参数列)
(5)Divergent Change(发散式变化)
(6)Shortgun Surgery(霰弹式修改)
(7)Feature Envy(依恋情结)
(8)Data Clumps(数据泥团)
(9)Primitive Obsession(基本型别偏执)
(10)Switch Statements(switch惊悚现身)
(11)Parallel Inheritance Hierarchies(平行继承体系)
(12)Lazy Class(冗赘类)
(13)Speculative Generality(夸夸其谈未来性)
(14)Temporary Field(令人迷惑的暂时值域)
(15)Message Chains(过度耦合的消息链)
(16)Middle Man(中间转手人)
(17)Inappropriate Intimacy(狎昵关系)
(18)Alternative Classes with Different Interfaces(异曲同工的类)
(19)Incomplete Library Class(不完善的程序库类)
(20)Data Class(纯稚的数据类)
(21)Refused Bequest(被拒绝的遗赠)
(22)Comments(过多的注释)
重新组织函数:
(1)Extract Method(提炼函数)
(2)Inline Method(将函数内联化)
(3)Inline Temp(将临时变量内联化)
(4)Replace Temp With Query(以查询取代临时变量)
(5)Introduce Explaining Variable(引入解释性变量)
(6)Split Temporary Variable(剖解临时变量)
(7)Remove Assignments to Parameters(移除对参数的赋值动作)
(8)Replace Method with Method Object(以函数对象取代函数)
(9)Substitute Algorithm(替换你的算法)
在对象之间移动特性(Moving Features Between Objects):
(1)Move Method(搬移函数)
(2)Move Field(搬移值域)
(3)Extract Class(提炼类)
(4)Inline Class(将类内联化)
(5)Hide Delegate(隐藏「委托关系」)
(6)Remove Middle Man(移除中间人)
(7)Introduce Foreign Method(引入外加函数)
(8)Introduce Local Extension(引入本地扩展)
重新组织你的数据(Organizing Data):
(1)Self Encapsulate Field(自封装值域)
(2)Replace Data Value with Object(以对象取代数据值)
(3)Change Value to Reference(将实值对象改为引用对象)
(4)Change Reference to Value(将引用对象改为实值对象)
(5)Replace Array with Object(以对象取代数组)
(6)Duplicate Observed Data(复制「被监视数据」)
(7)Change Unidirectional Association to Bidirectional(将单向关联改为双向)
(8)Change Bidirectional Association to Unidirectional(将双向关联改为单向)
原文地址:http://blog.csdn.net/u011742227/article/details/41842407