没有合适的资源?快使用搜索试试~ 我知道了~
首页Refactoring: Improving the Design of Existing Code 第二版
Martin大叔经典著作《重构》第二版,仅供交流学习之用。 This eagerly awaited new edition has been fully updated to reflect crucial changes in the programming landscape.Refactoring, Second Edition,features an updated catalog of refactorings and includes JavaScript code examples, as well as new functional examples that demonstrate refactoring without classes.
资源详情
资源评论
资源推荐


Refactoring
ImprovingtheDesignofExistingCode
SecondEdition
MartinFowler
withcontributionsby
KentBeck
Boston•Columbus•NewYork•SanFrancisco•Amsterdam•CapeTown
Dubai•London•Madrid•Milan•Munich•Paris•Montreal•Toronto•Delhi•
MexicoCity
SãoPaulo•Sydney•HongKong•Seoul•Singapore•Taipei•Tokyo
History
Topics
Tutorials
Offers & Deals
Highlights
Settings
Support
Sign Out

Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheir
productsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,and
thepublisherwasawareofatrademarkclaim,thedesignationshavebeenprintedwith
initialcapitallettersorinallcapitals.
Theauthorandpublisherhavetakencareinthepreparationofthisbook,butmakeno
expressedorimpliedwarrantyofanykindandassumenoresponsibilityforerrorsor
omissions.Noliabilityisassumedforincidentalorconsequentialdamagesin
connectionwithorarisingoutoftheuseoftheinformationorprogramscontained
herein.
Forinformationaboutbuyingthistitleinbulkquantities,orforspecialsales
opportunities(whichmayincludeelectronicversions;customcoverdesigns;and
contentparticulartoyourbusiness,traininggoals,marketingfocus,orbranding
interests),pleasecontactourcorporatesalesdepartmentatcorpsales@pearsoned.com
or(800)382–3419.
Forgovernmentsalesinquiries,pleasecontactgovernmentsales@pearsoned.com.
ForquestionsaboutsalesoutsidetheU.S.,pleasecontactintlcs@pearson.com.
VisitusontheWeb:informit.com/aw
LibraryofCongressControlNumber:2018950015
Copyright©2019PearsonEducation,Inc.
Coverphoto:WaldoHancockBridge&PenobscotNarrowsBridgebyMartinFowler
Lightbulbgraphic:IrinaAdamovich/Shutterstock
Allrightsreserved.PrintedintheUnitedStatesofAmerica.Thispublicationis
protectedbycopyright,andpermissionmustbeobtainedfromthepublisherpriorto
anyprohibitedreproduction,storageinaretrievalsystem,ortransmissioninanyform
orbyanymeans,electronic,mechanical,photocopying,recording,orlikewise.For
Playlists
History
Topics
Tutorials
Offers & Deals
Highlights
Settings
Support
Sign Out
i

informationregardingpermissions,requestformsandtheappropriatecontactswithin
thePearsonEducationGlobalRights&PermissionsDepartment,pleasevisit
www.pearsoned.com/permissions/.
ISBN13:9780134757599
ISBN10:0134757599
118

Chapter 1
Refactoring: A First Example
HowdoIbegintotalkaboutrefactoring?Thetraditionalwayisbyintroducingthe
historyofthesubject,broadprinciples,andthelike.Whensomebodydoesthatata
conference,Igetslightlysleepy.Mymindstartswandering,withalowpriority
backgroundprocesspollingthespeakeruntiltheygiveanexample.
TheexampleswakemeupbecauseIcanseewhatisgoingon.Withprinciples,itistoo
easytomakebroadgeneralizations—andtoohardtofigureouthowtoapplythings.An
examplehelpsmakethingsclear.
SoI’mgoingtostartthisbookwithanexampleofrefactoring.I’lltalkabouthow
refactoringworksandwillgiveyouasenseoftherefactoringprocess.Icanthendothe
usualprinciplesstyleintroductioninthenextchapter.
Withanyintroductoryexample,however,Irunintoaproblem.IfIpickalarge
program,describingitandhowitisrefactoredistoocomplicatedforamortalreaderto
workthrough.(Itriedthiswiththeoriginalbook—andendedupthrowingawaytwo
examples,whichwerestillprettysmallbuttookoverahundredpageseachtodescribe.)
However,ifIpickaprogramthatissmallenoughtobecomprehensible,refactoring
doesnotlooklikeitisworthwhile.
I’mthusintheclassicbindofanyonewhowantstodescribetechniquesthatareuseful
forrealworldprograms.Frankly,itisnotworththeefforttodoalltherefactoringthat
I’mgoingtoshowyouonthesmallprogramIwillbeusing.ButifthecodeI’mshowing
youispartofalargersystem,thentherefactoringbecomesimportant.Justlookatmy
exampleandimagineitinthecontextofamuchlargersystem.
THE STARTING POINT
Inthefirsteditionofthisbook,mystartingprogramprintedabillfromavideorental
store,whichmaynowleadmanyofyoutoask:“What’savideorentalstore?”Rather
thananswerthatquestion,I’vereskinnedtheexampletosomethingthatisbotholder
History
Topics
Tutorials
Offers & Deals
Highlights
Settings
Support
Sign Out
剩余454页未读,继续阅读














安全验证
文档复制为VIP权益,开通VIP直接复制

评论0