重构HTML改善Web应用的设计

Chapter 1:Refactoring,a First Example 重构,第一个例子1
The Starting Point 起点1
The First Step in Refactoring 重构第一步7
Decomposing and Redistributing the Statement Method 分解并重组slalemenl方法8
Replacing the Conditional Logic on Price Code with Polymorphism 用多态代替价格条件逻辑代码34
Final Thoughts 结语52
Chapter 2:Principles in Refactoring 重构原则53
Defining Refactoring 何谓重构53
Why Should You Refactor? 为何重构55
When Should You Refactor? 何时重构57
What Do I Tell My Manager? 怎样说服经理60
Problems with Refactoring 重构的问题62
Refactoring and Design 重构与设计66
Refactoring and Performance 重构与性能69
Where Did Refactoring Come From? 重构的起源71
Chapter 3:Bad Smells in Code(by Kent Beck and Martin Fowler) 代码坏昧75
Duplicated Code 重复代码76
Long Method 过长方法76
Large Class 过长类78
Long Parameter List 过长参数列表78
Divergent Change 发散式变化79
Shotgun Surgery 霰弹式修改80
Feature Envy 特性依恋80
Data Clumps 数据泥团81
Primitive Obsession 基本类型偏执81
Switch Statements switch语句82
Parallel Inheritance Hierarchies 平行继承体系83
Lazy Class 冗余类83
Speculative Generality 理论上的一般性83
Temporary Field 临时字段84
Message Chains 消息链84
Middle Man 中间人85
Inappropriate Intimacy 过度亲密85
Alternative Classes with Different Interfaces 接口不同的等效类 85
Incomplete Library Class 不完整的库类86
Data Class 数据类86
Refused Bequest 拒绝继承87
Comments 注释过多87
Chapter 4:Building Tests 构建测试89
The Value of Self-testing Code 自测试代码的重要性89
The JUnit Testing Framework Junit测试框架91
Adding More Tests 添加更多测试97
Chapter 5:Toward a Catalog of Refactorings 重构目录103
Format of the Refactorings 重构描述的格式103
Finding References 寻找引用105
How Mature Are These Refactorings? 这些重构的成熟度如何 106
Chapter 6:Composing Methods 组合方法109
Extract Method 提取方法110
Inline Method 内联方法117
Inline Temp 内联临时变量119
*Replace Temp with Query 用查询方法代替临时变量120
Introduce Explaining Variable 引入解释性变量124
Split Temporary Variable 分离临时变量128
*Remove Assignments to Parameters 去除参数赋值131
Replace Method with Method Object 用方法对象代替方法135
Substitute Algorithm 替换算法139
Chapter 7:Moving Features Between Objects 在对象之间移动特性 141
*Move Method 移动方法142
Move Field 移动字段146
Extract Class 提取类149
Inline Class 内联类154
Hide Delegate 隐藏委托类157
Remove Middle Man 去除中间人160
Introduce Foreign Method 引入外加方法162
*Introduce Local Extension 引入本地扩展类164
Chapter 8:Organizing Data 组织数据169
Self Encapsulate Field 自封装字段171
Replace Data Value with Object 用对象代替数据值175
Change Value to Reference 将值对象改为引用对象179
Change Reference to Value 将引用对象改为值对象183
Replace Array with Object 用对象代替数组186
Duplicate Observed Data 重复被观察数据189
*Change Unidirectional Associationto Bidirectional 将单向关联改为双向197
Change Bidirectional Association to Unidirectional 将双向关联改为单向200
*Replace Magic Number with Symbolic Constant 用字面常量代替魔数204
Encapsulate Field 封装字段206
Encapsulate Collection 封装集合208
Replace Record with Data Class 用数据类代替记录217
*ReplaceType Code with Class 用类代替类型码218
Replace Type Code with Subclasses 用子类代替类型码223
Replace Type Code with State/Strategy用State/Strategy 代替类型码227
Replace Subclass with Fields 用字段代替子类232
Chapter 9:Simplifying Conditional Expressions 简化条件语句237
Decompose Conditional 分解条件语句238
Consolidate Conditional Expression 合并条件语句240
Consolidate Duplicate Conditional Fragments 合并重复的条件片段243
Remove Control Flag 去除控制标志24
The Starting Point 起点1
The First Step in Refactoring 重构第一步7
Decomposing and Redistributing the Statement Method 分解并重组slalemenl方法8
Replacing the Conditional Logic on Price Code with Polymorphism 用多态代替价格条件逻辑代码34
Final Thoughts 结语52
Chapter 2:Principles in Refactoring 重构原则53
Defining Refactoring 何谓重构53
Why Should You Refactor? 为何重构55
When Should You Refactor? 何时重构57
What Do I Tell My Manager? 怎样说服经理60
Problems with Refactoring 重构的问题62
Refactoring and Design 重构与设计66
Refactoring and Performance 重构与性能69
Where Did Refactoring Come From? 重构的起源71
Chapter 3:Bad Smells in Code(by Kent Beck and Martin Fowler) 代码坏昧75
Duplicated Code 重复代码76
Long Method 过长方法76
Large Class 过长类78
Long Parameter List 过长参数列表78
Divergent Change 发散式变化79
Shotgun Surgery 霰弹式修改80
Feature Envy 特性依恋80
Data Clumps 数据泥团81
Primitive Obsession 基本类型偏执81
Switch Statements switch语句82
Parallel Inheritance Hierarchies 平行继承体系83
Lazy Class 冗余类83
Speculative Generality 理论上的一般性83
Temporary Field 临时字段84
Message Chains 消息链84
Middle Man 中间人85
Inappropriate Intimacy 过度亲密85
Alternative Classes with Different Interfaces 接口不同的等效类 85
Incomplete Library Class 不完整的库类86
Data Class 数据类86
Refused Bequest 拒绝继承87
Comments 注释过多87
Chapter 4:Building Tests 构建测试89
The Value of Self-testing Code 自测试代码的重要性89
The JUnit Testing Framework Junit测试框架91
Adding More Tests 添加更多测试97
Chapter 5:Toward a Catalog of Refactorings 重构目录103
Format of the Refactorings 重构描述的格式103
Finding References 寻找引用105
How Mature Are These Refactorings? 这些重构的成熟度如何 106
Chapter 6:Composing Methods 组合方法109
Extract Method 提取方法110
Inline Method 内联方法117
Inline Temp 内联临时变量119
*Replace Temp with Query 用查询方法代替临时变量120
Introduce Explaining Variable 引入解释性变量124
Split Temporary Variable 分离临时变量128
*Remove Assignments to Parameters 去除参数赋值131
Replace Method with Method Object 用方法对象代替方法135
Substitute Algorithm 替换算法139
Chapter 7:Moving Features Between Objects 在对象之间移动特性 141
*Move Method 移动方法142
Move Field 移动字段146
Extract Class 提取类149
Inline Class 内联类154
Hide Delegate 隐藏委托类157
Remove Middle Man 去除中间人160
Introduce Foreign Method 引入外加方法162
*Introduce Local Extension 引入本地扩展类164
Chapter 8:Organizing Data 组织数据169
Self Encapsulate Field 自封装字段171
Replace Data Value with Object 用对象代替数据值175
Change Value to Reference 将值对象改为引用对象179
Change Reference to Value 将引用对象改为值对象183
Replace Array with Object 用对象代替数组186
Duplicate Observed Data 重复被观察数据189
*Change Unidirectional Associationto Bidirectional 将单向关联改为双向197
Change Bidirectional Association to Unidirectional 将双向关联改为单向200
*Replace Magic Number with Symbolic Constant 用字面常量代替魔数204
Encapsulate Field 封装字段206
Encapsulate Collection 封装集合208
Replace Record with Data Class 用数据类代替记录217
*ReplaceType Code with Class 用类代替类型码218
Replace Type Code with Subclasses 用子类代替类型码223
Replace Type Code with State/Strategy用State/Strategy 代替类型码227
Replace Subclass with Fields 用字段代替子类232
Chapter 9:Simplifying Conditional Expressions 简化条件语句237
Decompose Conditional 分解条件语句238
Consolidate Conditional Expression 合并条件语句240
Consolidate Duplicate Conditional Fragments 合并重复的条件片段243
Remove Control Flag 去除控制标志24
Elliotte Rusty Harold世界知名技术作家、程序员,纽约科技大学计算机系副教授。讲授面向对象编程方面的课程。他的网站Cafe con Leche是XML方面的热门网站之一。他著有Effective XML和XML in a Nutshell等一系列知名作品。
本书采用理论与实践相结合的方式,展示了如何重构HTML,以获得更佳的可靠性、性能、可用性、安全性、可访问性、兼容性,甚至实现良好的搜索引擎优化。书中详细介绍了如何辨别应该重构的Web代码中的“坏味道”,如何把旧的HTML转换为良构和有效的XHTML,如何使用CSS改善现有的布局,如何通过用GET替换POST、替换旧的联系表单和重构JavaScfipt来更新Web应用程序,如何系统地重构内容和链接,如何在不改变用户所依赖的URL的前提下重建网站。
本书适合Web设计人员、开发人员、项目经理和需要维护或更新既有网站的人使用。
本书适合Web设计人员、开发人员、项目经理和需要维护或更新既有网站的人使用。
比价列表
公众号、微信群

微信公众号

实时获取购书优惠