`
温柔一刀
  • 浏览: 860584 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Refactorings(重构)列表

    博客分类:
  • java
阅读更多

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(梳理并分解继承体系)

分享到:
评论

相关推荐

    重构 小抄 Smells to Refactorings

    重构是软件开发中一项重要的技能,指的是在不改变外部行为的前提下,改善代码内部结构的技术。重构能够提高代码的可读性、可维护性和可扩展性,从而提升软件质量。《重构:改善既有代码的设计》一书为程序员提供了一...

    Refactorings in Large Software Projects

    大型软件项目中的重构是软件开发过程中的一个重要环节。重构的目的是在不改变软件系统外部行为的前提下,改善其内部结构。这包括调整代码结构、优化设计模式、提高代码的可读性和可维护性,以及去除代码中的异味...

    重构-改善既有代码的设计(中文版)

    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构   Tease Apart Inheritance 分解继承层次   Convert Procedural Design to Objects 将过程式设计转换为面向对象   Separate Domain ...

    重构-改善既有代码的设计+中文版

    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构   Tease Apart Inheritance 分解继承层次   Convert Procedural Design to Objects 将过程式设计转换为面向对象   Separate Domain ...

    重构 改善既有代码的设计

    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构   Tease Apart Inheritance 分解继承层次   Convert Procedural Design to Objects 将过程式设计转换为面向对象   Separate ...

    重构——改善既有代码的设计

    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构   Tease Apart Inheritance 分解继承层次   Convert Procedural Design to Objects 将过程式设计转换为面向对象   Separate Domain ...

    重构,改善既有代码的设计

    Chapter 12:Big Refactorings(by Kent Beck and Martin Fowler) 大型重构   Tease Apart Inheritance 分解继承层次   Convert Procedural Design to Objects 将过程式设计转换为面向对象   Separate ...

    重构_改善既有代码的设计

    第 12 章:大型重构(Big Refactorings, by Kent Beck and Martin Fowler) 第 13 章:重构、复用与现实 第 14 章:重构工具(Refactoring Tools, by Don Roberts and John Brant) 第 15 章:集成(Put It ...

    重构_改善既有代码的设计.pdf

    重构_改善既有代码的设计。重构是这样一个过程:在不改变代码的外在行为的前提下,对代码做出修改,以改进程序的内部结构。本质上说,重构就是“在代码写好之后改进它的设计”。

    long-refactorings-talk:关于长时间重构的讨论

    关于“长期重构”的讨论你可以在网上查看: : (单击向右箭头和向左箭头以浏览幻灯片) 这是一个谈话。 在本地查看: $ bundle install$ bundle exec mdpress --images images -r talk.md本次演讲已/计划在以下地点...

    Refactoring to Patterns

    #### 重要概念:Refactoring(重构) **重构**是一种软件开发过程中常用的技巧,旨在改进现有代码结构而不改变其外部行为。这一过程可以帮助开发者提高代码的可读性和可维护性,同时也能够简化未来的修改和扩展工作...

    Antipattern based Use Case Refactorings-开源

    《基于反模式的用例重构:ATL代码开源解析》 在软件开发过程中,用例重构是一项关键的任务,它涉及到对系统中已有用例的改进和优化,以提高软件的质量和可维护性。"Antipattern based Use Case Refactorings" 是一...

    vim-refactor:Vim的通用重构插件

    **vim-refactor:Vim的通用重构插件** 在编程世界中,重构是提升代码质量、可读性和可维护性的重要手段。对于Vim用户来说,`vim-refactor`是一个非常实用的插件,它提供了丰富的重构功能,帮助开发者在Vim编辑器中...

    依赖网络中使用社区检测的面向对象软件的类结构重构

    它还通过比较优化的类结构与软件系统中的实际类结构并检查属性方法网络来提供重构列表。 使用开放源代码案例研究JHotDraw 5 1对这种方法进行了评估,并与现有方法进行了比较说明了我们方法的优点。

    code-complexity:测量搅拌复杂度比。 较高的值表示应该进行重构的热点

    代码复杂度 测量流失率/复杂度得分。 较高的值表示应该进行重构的热点。... Higher values mean hotspots where refactorings should happen. Options: -V, --version output the version number

    resharper-introduce-ns-alias:ReSharper 重构以引入命名空间

    1. **选择重构**:在代码中找到冲突的`using`语句,右键点击,选择“ReSharper” -> “Refactorings” -> “Introduce Namespace Alias”。 2. **设置别名**:ReSharper会提示你输入新的别名名称,或者自动生成一个...

    refactoring-code-smells:Example示例项目说明了代码气味,以应用重构技术

    从代码气味重构为干净代码 :soap: :pile_of_poo: :SOON_arrow: :rainbow: :unicorn: 重构和代码气味目录的展示,并用不同编程语言的实际示例进行了说明。 · 加注· :brain: 概念 :pile_of_poo: 代码闻起来这些就是...

    clj-refactor.el:Emacs的Clojure重构功能的集合

    clj-refactor为Clojure项目提供重构支持。 它补充了您在clojure-mode和CIDER中发现的重构功能。 这是一个小型预告片,可帮助您添加缺少的libspec: 安装 强烈建议通过package.el安装clj-refactor 。 在和上可用:...

    西红柿插件

    同时,它支持代码高亮、格式化和重构,帮助保持代码整洁,提高代码可读性。 在调试方面,【西红柿插件】也表现出色。它支持断点设置、单步调试、查看变量值等调试功能,使得开发者能够更直观地了解程序运行状态,...

Global site tag (gtag.js) - Google Analytics