第1章 本书的写作缘由

第2章 重构

第3章 模式

第4章 代码坏味

第5章 模式导向的重构目录

第6章 创建

第7章 简化

第8章 泛化

第9章 保护

第10章 聚集操作

第11章 实用重构

参考文献

第1章 本书的写作缘由

  1.1 过渡设计

  1.2 模式万灵丹

  1.3 设计不足

  1.4 测试驱动开发和持续重构

  1.5 重构与模式

  1.6 演进式设计

第2章 重构

  2.1 何谓重构

  2.2 重构的动机

  2.3 众目睽睽

  2.4 可读性好的代码

  2.5 保持清晰

  2.6 循序渐进

  2.7 设计欠账

  2.8 演变出新的架构

  2.9 复合重构与测试驱动的重构

  2.10 复合重构的优点

  2.11 重构工具

第3章 模式

  3.1 何谓模式

  3.2 模式痴迷

  3.3 实现模式的方式不止一种

  3.4 通过重构实现,趋向和去除模式

  3.5 模式是否会使代码更加复杂

  3.6 模式知识

  3.7 使用模式的预先设计

第4章 代码坏味

  4.1 重复代码 (Duplicated Code)

  4.2 过长函数 (Long Method)

  4.3 条件逻辑太复杂 (Conditional Complexity)

  4.4 基本类型偏执 (Primitive Obsession)

  4.5 不恰当的暴露 (Indecent Exposure)

  4.6 解决方案蔓延 (Solution Sprawl)

  4.7 异曲同工的类 (Alternative Classes with Different Interfaces)

  4.8 冗赘类 (Lazy Class)

  4.9 过大的类 (Large Class)

  4.10 分支语句 (Switch Statement)

  4.11 组合爆炸 (Combinatorial Explosion)

  4.12 怪异解决方案 (Oddball Solution)

第5章 模式导向的重构目录

  5.1 重构的格式

  5.2 本目录中的引用的项目

    5.2.1 XML Builder

    5.2.2 HTML Parser

    5.2.3 贷款风险计算程序

  5.3 起点

  5.4 学习顺序

第6章 创建

  6.1 用Creation Method 替换构造函数

    6.1.1 动机

    6.1.2 做法

    6.1.3 示例

    6.1.4 变体

  6.2 将创建知识搬移到Factory

    6.2.1 动机

    6.2.2 做法

    6.2.3 示例

  6.3 用Factory封装类

    6.3.1 动机

    6.3.2 做法

    6.3.3 示例

    6.3.4 变体

  6.4 用Factory Method引入多态创建

    6.4.1 动机

    6.4.2 做法

    6.4.3 示例

  6.5 用Builder封装Composite

    6.5.1 做法

    6.5.2 示例

    6.5.3 变体

  6.6 内联Singleton

    6.6.1 动机

    6.6.2 做法

    6.6.3 示例

第7章 简化

  7.1 组合方法

    7.1.1 动机

    7.1.2 做法

    7.1.3 示例

  7.2 用Strategy 替换条件逻辑

    7.2.1 动机

    7.2.2 做法

    7.2.3 示例

  7.3 将装饰功能搬移到Decorator

    7.3.1 动机

    7.3.2 做法

    7.3.3 示例

  7.4 用State替换状态改变条件语句

    7.4.1 动机

    7.4.2 做法

    7.4.3 示例

  7.5 用Composite替换隐含树

    7.5.1 动机

    7.5.2 做法

    7.5.3 示例

  7.6 用Command替换条件调度程序

    7.6.1 动机

    7.6.2 做法

    7.6.3 示例

第8章 泛化

  8.1 形成Template Method

    8.1.1 动机

    8.1.2 做法

    8.1.3 示例

  8.2 提取Composite

    8.2.1 动机

    8.2.2 做法

    8.2.3 示例

  8.3 用Composite替换一/多之分

    8.3.1 动机

    8.3.2 做法

    8.3.3 示例

  8.4 用Observer 替换硬编码的通知

    8.4.1 动机

    8.4.2 做法

    8.4.3 示例

  8.5 通过Adapter统一接口

    8.5.1 动机

    8.5.2 做法

    8.5.3 示例

  8.6 提取Adapter

    8.6.1 动机

    8.6.2 做法

    8.6.3 示例

    8.6.4 变体

  8.7 用Interpreter替换隐式语言

    8.7.1 动机

    8.7.2 做法

    8.7.3 示例

第9章 保护

  9.1 用类替换类型代码

    9.1.1 动机

    9.1.2 做法

    9.1.3 示例

  9.2 用Singleton限制实例化

    9.2.1 动机

    9.2.2 做法

    9.2.3 示例

  9.3 引入Null Object

    9.3.1 动机

    9.3.2 做法

    9.3.3 示例

第10章 聚集操作

  10.1 将聚集操作搬移到Collecting Parameter

    10.1.1 动机

    10.1.2 做法

    10.1.3 示例

  10.2 将聚集操作搬移到Visitor

    10.2.1 动机

    10.2.2 做法

    10.2.3 示例

第11章 实用重构

  11.1 链构造函数

    11.1.1 动机

    11.1.2 做法

    11.1.3 示例

  11.2 统一接口

    11.2.1 动机

    11.2.2 做法

    11.2.3 示例

  11.3 提取参数

    11.3.1 动机

    11.3.2 做法

    11.3.3 示例

参考文献

Alexander, Christopher. A Pattern Language. New York: Oxford University Press, 1977.

Alexander, Christopher. A Timeless Way of Building. New York: Oxford University Press, 1979.

Anderson, Bruce. "Null Object." UIUC Patterns Discussion Mailing List (patterns@cs.uiuc.edu), January 1995.

Astels, David. Test-Driven Development, a Practical Guide. Upper Saddle River, NJ: Prentice Hall,2003.

Barzun, Jacques. Simple and Direct, 4th ed. New York: HarperCollins,2001.

Beck, Kent. Smalltalk Best Practice Patterns. Upper Saddle River, NJ: Prentice Hall, 1997.

Beck, Kent, Test-Driven Development. Boston, MA: Addison-Wesley, 2002

Beck, Kent, Extreme Programming Explained.Reading, MA: Addison-Wesley,1999.

Beck, Kent, and Erich Gamma. JUnit Testing Framework. Available online at  http://www.junit.org. See also Erich Gamma and Kent Beck, "JUnit: A Cook's Tour," Java Report, May 1999

Bloch, Joshua. Effective Java. Boston, MA: Addison-Wesley, 2001

Cunningham, Ward. "Checks: A Pattern Language of Infomation Integrity." In Pattern Languages of Program Desgin, eds. James O. Coplien and Douglas C. Schmidt. Reading, MA: Addison-Wesley, 1995

Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Reading, MA: Addison-Wesley,1995

Evans, Eric. Domain-Driven Design. Boston, MA: Addison-Wesley, 2003.

Foote, Brian, and Joseph Yoder. "Big Ball of Mud." In Pattern Language of Program Design IV, eds. Neil Harrison, Brian Foote, and Hans Rohnert. Boston, MA: Addison-Wesley,2000.

Fowler, Martin. Refactoring: Improving the Design of Existing Code. Boston, MA: Addison-Wesley, 2000

Fowler, Martin. Patterns of Enterprise Application Architecture. Boston, MA: Addison-Wesley, 2003

Fowler,Martin. UML Distilled,3rd ed. Boston, MA: Addison-Wesley,2003

Gamma,Erich, and Kent Beck. Contributing to Eclipse. Boston, MA: Addison-Wesley, 2003.

Kerievsky, Joshua. "Patterns & XP." In Extreme Programming Examined, eds. Giancarlo Succi and Michele Marchesi. Boston, MA: Addison-Wesley, 2001.

Parnas, David. "On the Criteria to Be Used in Decomposing Systems into Modules." Communications of the ACM, 15(2), 1972.

Roberts, Don, John Brant, and Ralph Johnson. "A Refactoring Tool for Smalltalk." Available online at http://st-www.cs.uiuc.edu/~droberts/tapos/TAPOS.htm

Solomon, Maynard. Mozart. New York: HarperCollins, 1995

Vlissides, John. "C++ Report." April 1998. Available online at http://www.research.ibm.com/designpatterns/pubs/ph-apr98.pdf

Woolf, Boddy. "The Null Object Pattern." In Pattern Languages of Program Design III, eds. Robert C.Martin, Dirk Riehle, and Frank Buschmann. Reading, MA: Addison-Wesley,1997.

最新文章

  1. 关于docker
  2. Bitmap 的几种压缩方式
  3. DeepLearning学习(1)--多层感知机
  4. SpringMVC框架介绍
  5. Phonegap 之 iOS银联在线支付(js调用ios端银联支付控件)
  6. 组合数学 - 母函数的运用 --- hdu 1709 :The Balance
  7. UITapGestureRecognizer 和 CCMenu点击问题
  8. 跟我一起Django - 01 安装和初始化
  9. 用HTML5 Canvas 做擦除及扩散效果
  10. 查看哪些ip破解你ssh密码以及次数
  11. 表单验证插件jquery.validate的使用方法演示
  12. 求N以内与N互质的数的和
  13. SQL Server 2016 行级别权限控制
  14. [CF932E]Team Work & [BZOJ5093]图的价值
  15. Kali Linux安装Google中文输入法(只需5步)
  16. (转)每天进步一点点——五分钟理解一致性哈希算法(consistent hashing)
  17. matlab的conv2、imfilter、filter2
  18. 一.hadoop入门须知
  19. C++ 调用 opencv 读取视频文件列表并处理
  20. 一些你可能需要的okhttp实现

热门文章

  1. Ubuntu sudo 免密码
  2. 07-selenium、PhantomJS(无头浏览器)
  3. laravel中select2多选,初始化默认选中项
  4. 基于 H5 + WebGL 实现的地铁站 3D 可视化系统
  5. DevExpress的分页Tab控件XtraTabControl控件的使用
  6. Implement Custom Business Classes and Reference Properties 实现自定义业务类和引用属性(XPO)
  7. Linux域名服务DNS
  8. JS基础语法---数组
  9. FCC---Animate Multiple Elements at Variable Rates---还可以改循环时间,达到不同律动频率的效果
  10. 【转载】Gradle for Android 第六篇( 测试)