重构

重构 pdf epub mobi txt 电子书 下载 2025

出版者:人民邮电出版社
作者:[美] Martin Fowler
出品人:
页数:452
译者:
出版时间:2010-11
价格:69.00元
装帧:平装
isbn号码:9787115239143
丛书系列:图灵程序设计丛书·程序员修炼系列
图书标签:
  • 重构
  • 软件设计
  • 软件开发
  • 软件工程
  • 编程
  • 计算机科学
  • programming
  • IT
  • 重构
  • 代码质量
  • 软件设计
  • 编程实践
  • 代码改进
  • 可维护性
  • 设计模式
  • 软件工程
  • 代码整洁
  • 技术书籍
想要找书就要到 小美书屋
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

重构,一言以蔽之,就是在不改变外部行为的前提下,有条不紊地改善代码。多年前,正是本书原版的出版,使重构终于从编程高手们的小圈子走出,成为众多普通程序员日常开发工作中不可或缺的一部分。本书也因此成为与《设计模式》齐名的经典著作,被译为中、德、俄、日等众多语言,在世界范围内畅销不衰。

本书凝聚了软件开发社区专家多年摸索而获得的宝贵经验,拥有不因时光流逝而磨灭的价值。今天,无论是重构本身,业界对重构的理解,还是开发工具对重构的支持力度,都与本书最初出版时不可同日而语,但书中所蕴涵的意味和精华,依然值得反复咀嚼,而且往往能够常读常新。

作者简介

Martin Fowler 世界软件开发大师,在面向对象分析设计、UML、模式、XP和重构等领域都有卓越贡献,现为著名软件开发咨询公司ThoughtWorks的首席科学家。他的多部著作《分析模式》、《UML精粹》和《企业应用架构模式》等都已经成为脍炙人口的经典。

其他参编者

Kent Beck 软件开发方法学的泰斗,极限编程的创始人。他是Three Rivers Institute公司总裁,也是Agitar Software的成员。

John Brant和Don Roberts The Refactory公司的创始人,Refactoring Browser http://st-www.cs.illinois.edu/users/brant/Refactory/)的开发者,多年来一直从事研究重构的实践与理论。

William Opdyke 目前在朗讯贝尔实验室工作,他写的关于面向对象框架的博士论文是重构方面的第一篇著名文章。

目录信息

Chapter 1 Refactoring, a First Example 1
The Starting Point   1
The First Step in Refactoring   7
Decomposing and Redistributing the Statement Method   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 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 Class86
Data Class   86
Refused Bequest    87
Comments   87
Chapter 4: Building Tests  89
The Value of Self-testing Code   89
The JUnit Testing Framework   91
Adding More Tests   97
Chapter 5: Toward a Catalog of Refactorings
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 Association to 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
Replace Type Code with Class    218
Replace Type Code with Subclasses  223
Replace Type Code with 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    245
Replace Nested Conditional with Guard Clauses   250
Replace Conditional with Polymorphism   255
Introduce Null Object  260
Introduce Assertion   267
Chapter 10: Making Method Calls Simpler    271
Rename Method    273
Add Parameter   275
Remove Parameter 277
Separate Query from Modifier   279
Parameterize Method   283
Replace Parameter with Explicit Methods   285
Preserve Whole Object    288
Replace Parameter with Method   292
Introduce Parameter Object    295
Remove Setting Method  300
Hide Method   303
Replace Constructor with Factory Method     304
Encapsulate Downcast   308
Replace Error Code with Exception   310
Replace Exception with Test   315
Chapter 11: Dealing with Generalization319
Pull Up Field    320
Pull Up Method   322
Pull Up Constructor Body    325
Push Down Method   328
Push Down Field   329
Extract Subclass   330
Extract Superclass  336
Extract Interface   341
Collapse Hierarchy    344
Form Template Method  345
Replace Inheritance with Delegation   352
Replace Delegation with Inheritance   355
Chapter 12: Big Refactorings (by Kent Beck and Martin Fowler)  359
Tease Apart Inheritance  362
Convert Procedural Design to Objects   368
Separate Domain from Presentation   370
Extract Hierarchy    375
Chapter 13: Refactoring, Reuse, and Reality (by William Opdyke)   379
A Reality Check     380
Why Are Developers Reluctant to Refactor
Their Programs     381
A Reality Check (Revisited)    394
Resources and References for Refactoring   394
Implications Regarding Software Reuse and Technology Transfer     395
A Final Note397
References                   397
Chapter 14: Refactoring Tools (by Don Roberts and John Brant) 401
Refactoring with a Tool   401
Technical Criteria for a Refactoring Tool   403
Practical Criteria for a Refactoring Tool   405
Wrap Up   407
Chapter 15: Putting It All Together (by Kent Beck)   409
References    413
List of Soundbites     417
Index  419
· · · · · · (收起)

读后感

评分

无论你是初出江湖的编码小农,还是深耕多年的程序大牛,这本书都值得你深度品读。 常常我们说的代码简洁性、易读性、健壮性,都并非一日之功,需要在日常的迭代中不断持续的进行重构,重构的事情我们常常挂在嘴边,却往往无从下手,本书以作者丰富的编程经验和思想,总结了一套...  

评分

《重构》这本书我觉得没什么意思。这本书有个矛盾点:对有丰富经验的程序员来说,这本书上面所提到的所谓手法已经是他们日常编程中已经熟练使用的,这本书只是给这些手法命了个名而已,看这本书毫无意义。而对于新手程序员来说,因为你没有一定的代码量,应该是看不懂书上说的...  

评分

第一遍于两年前, 让我了解到bad smell们, 还有那冗长的手法catalog. 最近第二遍, 回顾过去, 虽然bad smell的提示和重构操作已经完全融入现代IDE中了, 但总结下来它对我的影响还有如下: 1.我常常通过重构来加深对代码的理解. 2.让我变成一个十足的代码洁癖者, "刻"代码上瘾...  

评分

组里最主要的Service已经运行了几年了,目前大约有40000行代码,不少部分缺乏Unit Tests。每次看代码的时候都有一种想重构的冲动。 不过什么时候才重构呢?经理那里是不好交差的——他们关心的是新功能的实现速度。有的时候重写反而(对程序员)的发展更好,因为工作量明显的...  

评分

书中说过重构的思想由来已久,只不过没人写成书籍罢了。 个人感觉如果你看完这本书只看到了思想,那你就错过了很多有价值的东西。小步骤的重构,如何最大限度的不引入bug才是书中要告诉大家的。像了解重构思想,只看前几章就够了。我个人认为书中最有价值的东西恰恰是进行重构...  

用户评价

评分

2013-07-20断断续续终于看完一遍了,后面就放到桌子上当作参考手册了,需要的时候翻翻//淘宝买的,很久没买书了。纸质的有点臭,在桌子上摊开有段时间了,没气味了。

评分

2013-07-20断断续续终于看完一遍了,后面就放到桌子上当作参考手册了,需要的时候翻翻//淘宝买的,很久没买书了。纸质的有点臭,在桌子上摊开有段时间了,没气味了。

评分

主要是代码层次的经验,大牛间逐渐形成的一些无形规范,读的很快,有时间可以再翻下,回头对照自己的代码。

评分

主要是代码层次的经验,大牛间逐渐形成的一些无形规范,读的很快,有时间可以再翻下,回头对照自己的代码。

评分

2013-07-20断断续续终于看完一遍了,后面就放到桌子上当作参考手册了,需要的时候翻翻//淘宝买的,很久没买书了。纸质的有点臭,在桌子上摊开有段时间了,没气味了。

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2025 book.quotespace.org All Rights Reserved. 小美书屋 版权所有