Refactoring

本网站不提供下载链接,喜欢看书的朋友请关注公众号:【lennylee的碎碎念】(lennyleede),首页回复:授人以渔,自动获取搜索资源的方法。

内容简介:

Refactoring is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. With refactoring you can even take a bad design and rework it into a good one. This book offers a thorough discussion of the principles of refactoring, including where to spot opportunities for refactoring, and how to set up the required tests. There is also a catalog of more than 40 proven refactorings with details as to when and why to use the refactoring, step by step instructions for implementing it, and an example illustrating how it works The book is written using Java as its principle language, but the ideas are applicable to any OO language.

作者简介:

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 目前在朗讯贝尔实验室工作,他写的关于面向对象框架的博士论文是重构方面的第一篇著名文章。

原文摘录:

养成重构后即运行测试的习惯非常重要。犯错误是很容易的——至少我知道我是很容易犯错的。做完一次修改就运行测试,这样在我真的犯了错时,只需要考虑一个很小的改动范围,这使得查错与修复问题易如反掌。这就是重构过程的精髓所在:小步修改,每次修改后就运行测试。如果我改动了太多东西,犯错时就可能陷入麻烦的调试,并为此耗费大把时间。小步修改,以及它带来的频繁反馈,正是防止混乱的关键。 (查看原文)

豆友152905485
2 回复
2赞
2022-03-11 07:50:36

—— 引自章节:1.4 分解statement函数 6

to make the software easier to understand and modify. (查看原文)

bluetingting
2赞
2012-07-17 13:21:13

—— 引自第44页