Refactorings(重构)列表
Refactoring:Improving the Design of Existing Code Refactorings
1. Add parameter(添加参数)
2. Change bidirectional association to unidirectional(将双向关联改为单项)
3. Change reference to value (将引用对象改为实值对象)
4. Change unidirectional assocation to bidirectional(将单项关联改为双向)
5. Change value to reference (将实值对象改为引用对象)
6. Collapse hierachy(折叠继承体系)
7. Consolidate conditional expression(合并条件式)
8. Consolidate duplicate conditional fragments(合并重复的条件判断)
9. Convert procedural design to objects(将过程化设计转化为对象设计)
10. Decompose conditional (分解条件式)
11. Duplicate observed data(复制“被监视数据”)
12. Encapsulate collection (封装群集)
13. Encapsulate downcast(封装“向下转型”动作)
14. Encapsulate field(封装值域)
15. Extract class(提炼类)
16. Extract hierarchy (提炼继承体系)
17. Extract interface(提炼接口)
18. Extract method(提炼函数)
19. Extract subclass(提炼子类)
20. Extract superclass(提炼超类)
21. Form template method(塑造模板函数)
22. Hide delegate(隐藏委托关系)
23. Hide method(隐藏函数)
24. Inline class (将类内联化)
25. Inline method(将函数内联化)
26. Inline Temp(将临时变量内联化)
27. Introduce assertion(引入断言)
28. Introduce explaining ariable(引入解释性变量)
29. Introduce foreign method(引入外加函数)
30. Introduce local extension(引入本地扩展)
31. Introduce null object(引入Null对象)
32. Introduce prrameter object(引入参数对象)
33. Move field (搬移值域)
34. Move method(搬移函数)
35. Parameterize method(令函数携带参数)
36. Preserve whole object(保持对象完整)
37. Pull up constructor body(构造函数本体上移)
38. Pull up field(值域上拉)
39. Pull up method(函数上拉)
40. Pull down field(值域下降)
41. Pull down method(函数下移)
42. Remove assignments to parameters(移除函数的赋值动作)
43. Remove control flag(移除控制标记)
44. Remove middleman(移除中间人)
45. Remove parameter(移除参数)
46. Remove setting method(移除设置函数)
47. Rename method(重新命名函数)
48. Replace array with object(以对象取代数组)
49. Replace conditionalwith polymorphism(以多态取代条件式)
50. Replace constructor with factory method(以工厂方法取代构造函数)
51. Replace data value with object(以对象取代数据值)
52. Replace delegation with inheritance(以继承取代委托)
53. Replace error code with exception(以异常取代错误码)
54. Replace exception with test(以测试取代异常)
55. Replace inheritance with delegation(以委托取代继承)
56. Replace magic number with symbolic constant(以字面常量代替魔法数字)
57. Replace method with method object(以函数对象取代函数)
58. Replace nested conditional with guard clauses(以卫语句取代条件式)
59. Replace parameter with method(以函数取代参数)
60. Replace parameter with explicit methods(以明确函数取代参数)
61. Replace record with data class(以数据类取代记录)
62. Replace subclass with field(以值域取代子类)
63. Replace temp with query(以查询取代临时变量)
64. Replace type code with class(以类取代型别码)
65. Replace type code with state/strategy(以state/strategy取代性别码)
66. Replace type code with subclass(以子类取代型别码)
67. Self encapsulate field(自封装值域)
68. Separate domain from presentation (将领域和表述/显示分开)
69. Separate query with modifier (将查询函数和修改函数分离)
70. Split tempory variable(剖解临时变量)
71. Substitue algorithm(替换你的算法)
72. Tease appart inheritance(梳理并分解继承体系)
上一篇: 你除了喂我还喂过谁?
下一篇: 当有人夸你好看