代码重构相关资源
admin 13年前
<h3><span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US"><br /> 什么是重构:<br /> </span></h3> <br /> 1、Refactoring是对已经完成的代码进行改进的过程。在不 对代码的外部行为进行改动的情况下,对代码内部的结 构进行优化。 <p><span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US">2、Refactoring是严谨地对完成的代码进行清理的从而减少 出错的一种方法。 </span></p> <p><span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US">3、Refactoring的实质是对完成代码的设计进行改进。 </span></p> <p><span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US">4、Refactoring是XP项目中每天的例行练习。 </span></p> <p><span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US">5、Refactoring必须和Test-Driven Design and Development伴随进行。 </span></p> <span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-fareast-language:ZH-CN;" lang="EN-US"> <h4><br /> Refactoring的目的: <br /> </h4> <p><strong>1. 改进软件的设计。</strong> <br /> <br /> 程序员对代码所做的为了满足短期利益代码改动,或再没有完全清 楚增个架构下的改动,都很容易是代码失去它的清晰结构,偏离需求或设计。而这些改动的积累很容易使代码偏离它原先设计的初衷而变得不可立即和无法维护。Refactoring则帮助重新组织代码,重新清晰的体现结构和进一步改进设计。 </p> <p><br /> <strong>2. 提高代码质量,可维护性。 <br /> <br /> </strong> 容易理解的代码可以很容易的维护和做进一步的开发。即使对写这 些代码的程序员本身,容易理解代码也可以帮助容易地做修改。程序代码也是文档。而代码首先是写给人看的,让后才是给计算机看的。 <br /> <br /> <strong>3. Refactoring帮助尽早的发现错误(Defects) <br /> </strong></p> <p> Refactoring是一个code review和反馈的过程。在另一个时段重新审视自己或别人代码,可以更容易的发现问题和加深对代码的理解。 Refactoring是一个良好的软件开发习惯。 </p> <p><br /> <strong>4. Refactoring可以提高提高开发速度 <br /> <br /> </strong> Refactoring对设计和代码的改进,都可以有效的提高开发速度。 好的设计和代码质量实体提高开发速度的关键。在一个有缺陷的设计和混乱代码基础上的开发,即使表面上进度较快,但本质是试延后对设计缺陷的发现和对错误的修改,也就是延后了开发风险,最终要在开发的后期付出更多的时间和代价。 <br /> </p> <div class="O" v:shape="_x0000_s1026"> <div style="mso-char-wrap:1;mso-kinsoku-overflow:1;mso-line-spacing:'100 20 0';mso-margin-left-alt:216;"> <span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:'Times New Roman';mso-ascii-font-family:楷体_GB2312;"> <div class="O" v:shape="_x0000_s1026"> <div style="mso-char-wrap:1;mso-kinsoku-overflow:1;mso-line-spacing:'90 20 0';mso-margin-left-alt:384;"> <span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;mso-ascii-font-family:楷体_GB2312;"> <div class="O" v:shape="_x0000_s1026"> <span style="font-family:SimSun;font-size:14px;mso-fareast-font-family:楷体_GB2312;mso-hansi-font-family:Arial;"> <div class="O" v:shape="_x0000_s1026"> <div style="mso-char-wrap:1;mso-kinsoku-overflow:1;mso-line-spacing:'100 50 0';mso-margin-left-alt:216;"> <br /> 下面介绍一些重构的相关资源,包括各种开发语言Java, Ruby, .Net, Python, PHP。 <br /> <br /> <p><strong>网站</strong></p> <p><a href="/misc/goto?guid=4958188143495101898">Wikipedia refactoring page</a><br /> <a href="/misc/goto?guid=4958188144245551766">Martin Fowler’s homepage about refactoring</a><br /> <a href="/misc/goto?guid=4958188144978593762">Wiki Pages About Refactoring</a><br /> <a href="/misc/goto?guid=4958188145715700981">Mikado Method for Large Scale Refactoring – Free draft for review</a><br /> <a href="/misc/goto?guid=4958188146450396125">Refactoring Databases – Evolutionary Database Design</a><br /> <a href="/misc/goto?guid=4958188147192922998">Refactoring To Patterns Catalog</a><br /> <a href="/misc/goto?guid=4958188147926253458">Refactor my code</a><br /> <a href="/misc/goto?guid=4958188148663000353">OODBMS Schema Refactoring Catalogue</a><br /> <a href="/misc/goto?guid=4958188149400537845">Fortran Refactorings</a></p> <p><strong>文章</strong></p> <p><a href="/misc/goto?guid=4958188150141769273">Code Smells</a><br /> <a href="/misc/goto?guid=4958188150878745066">Strategies for refactoring untestable PHP code</a><br /> <a href="/misc/goto?guid=4958188151619152906">A Developers’ Guide to Refactoring Databases</a><br /> <a href="/misc/goto?guid=4958188152352928892">Refactoring Large Software Systems</a><br /> <a href="/misc/goto?guid=4958188153108815759">Refactoring Automated Functional Test Scripts with iTest2</a><br /> <a href="/misc/goto?guid=4958188153854718293">Easy Database Refactoring</a><br /> <a href="/misc/goto?guid=4958188154606108819">Smells to Refactorings Quick Reference Guide</a><br /> <a href="/misc/goto?guid=4958188155336202402">Refactoring Java Code</a><br /> <a href="/misc/goto?guid=4958188156079266724">Refactoring for Python 3</a><br /> <a href="/misc/goto?guid=4958188156819117773">Refactoring Your Rails Application</a></p> <p><strong>视频</strong></p> <p><a href="/misc/goto?guid=4958188157559996788">Refactoring a Legacy Java Application to Rails</a><br /> <a href="/misc/goto?guid=4958188158292525984">Refactoring Ruby Apps</a><br /> <a href="/misc/goto?guid=4958188159037476631">Removing Duplication by Refactoring</a><br /> <a href="/misc/goto?guid=4958188159771985105">How Do I Refactor my Code in Visual Studio? Part 1</a><br /> <a href="/misc/goto?guid=4958188160519182154">How Do I Refactor my Code in Visual Studio? Part 2</a><br /> <a href="/misc/goto?guid=4958188161251546992">Refactoring Test Code</a><br /> <a href="/misc/goto?guid=4958188161992864959">Refactor Java Method</a><br /> <a href="/misc/goto?guid=4958188162742160742">Refactoring in Eclipse with a Closure Example</a><br /> <a href="/misc/goto?guid=4958188163481654220">Refactoring Functionality into a Library</a></p> <p><strong>书籍</strong></p> <p><a href="/misc/goto?guid=4958188164224539418">Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck, John Brant and William Opdyke</a><br /> <a href="/misc/goto?guid=4958188164965072841">Refactoring to Patterns by Joshua Kerievsky</a><br /> <a href="/misc/goto?guid=4958188165712272771">Refactoring: Ruby Edition Jay Fields by Jay Fields, Shane Harvie, Martin Fowler, Kent Beck</a><br /> <a href="/misc/goto?guid=4958188166445018134">Refactoring Databases: Evolutionary Database Design by Scott J Ambler and Pramodkumar J. Sadalage</a><br /> <a href="/misc/goto?guid=4958188167199534787">Professional Refactoring in C# & ASP.NET by Danijel Arsenovski</a><br /> <a href="/misc/goto?guid=4958188167932841453">xUnit Test Patterns: Refactoring Test Code by Gerard Meszaros</a><br /> <a href="/misc/goto?guid=4958188168677527688">Refactoring in Large Software Projects: Performing Complex Restructurings Successfully by Martin Lippert and Stephen Roock</a></p> <p><strong>开源工具</strong></p> <p><a href="/misc/goto?guid=4958188169429440839">Reek – Refactoring for Ruby</a><br /> <a href="/misc/goto?guid=4958188170177218536">Ropeide, a python refactoring IDE</a><br /> <a href="/misc/goto?guid=4958188170910564590">Wrangler is an interactive refactoring tool for Erlang</a><br /> <a href="/misc/goto?guid=4958188171657532918">ExtC – Java Extract Class refactoring</a><br /> <a href="/misc/goto?guid=4958188172397976868">Refactoring Plugin for Eclipse</a><br /> <a href="/misc/goto?guid=4958188173141844746">Chrysalis – A tool for XML Refactoring</a><br /> <a href="/misc/goto?guid=4958188173871389010">Cpparch – Tools for improving C++ program architecture</a><br /> <a href="/misc/goto?guid=4958188174608848025">F# Refactor</a></p> <br /> </div> </div> </span> </div> </span> </div> </div> </span> </div> </div></span>