skip to content
Refactoring Preview this item
ClosePreview this item

Refactoring

Author: Jay Fields; Shane Harvie; Martin Fowler
Publisher: Upper Saddle River, NJ : Addison-Wesley, ©2010.
Series: Addison-Wesley professional Ruby series.
Edition/Format:   Print book : English : Ruby edView all editions and formats
Summary:
The first refactoring guide specifically for Ruby - one of today's fastest growing programming languages Co-authored by Martin Fowler based on his legendary Refactoring, which started the refactoring revolution.
Rating:

(not yet rated) 0 with reviews - Be the first.

Subjects
More like this

 

Find a copy online

Links to this item

Find a copy in the library

&AllPage.SpinnerRetrieving; Finding libraries that hold this item...

Details

Material Type: Internet resource
Document Type: Book, Internet Resource
All Authors / Contributors: Jay Fields; Shane Harvie; Martin Fowler
ISBN: 9780321603500 0321603508 9780321984135 0321984137
OCLC Number: 234444821
Description: xxi, 454 pages : illustrations ; 24 cm.
Contents: Foreword . . . xiiiPreface . . . xvAcknowledgments . . . xxAbout the Authors . . . xxiiChapter 1: Refactoring, a First Example . . . 1The Starting Point . . . 2The First Step in Refactoring . . . 6Decomposing and Redistributing the Statement Method . . . 7Replacing the Conditional Logic on Price Code with Polymorphism . . . 32Final Thoughts . . . 50Chapter 2: Principles in Refactoring . . . 51Where Did Refactoring Come From? . . . 51Defining Refactoring . . . 52Why Should You Refactor? . . . 54When Should You Refactor? . . . 57Why Refactoring Works . . . 60What Do I Tell My Manager? . . . 61Indirection and Refactoring . . . 61Problems with Refactoring . . . 63Refactoring and Design. . . . 67It Takes A While to Create Nothing . . . 69Refactoring and Performance . . . 70Optimizing a Payroll System . . . 71Chapter 3: Bad Smells in Code . . . 73Duplicated Code . . . 74Long Method . . . 74Large Class . . . 76Long Parameter List . . . 76Divergent Change . . . 77Shotgun Surgery . . . 78Feature Envy . . . 78Data Clumps . . . 79Primitive Obsession . . . 79Case Statements . . . 80Parallel Inheritance Hierarchies . . . 81Lazy Class . . . 81Speculative Generality . . . 81Temporary Field . . . 82Message Chains . . . 82Middle Man . . . 83Inappropriate Intimacy . . . 83Alternative Classes with Different Interfaces . . . 83Incomplete Library Class . . . 84Data Class . . . 84Refused Bequest . . . 84Comments . . . 85Metaprogramming Madness . . . 86Disjointed API . . . 86Repetitive Boilerplate . . . 86Chapter 4: Building Tests . . . 87The Value of Self-Testing Code . . . 87The Test::Unit Testing Framework . . . 88Developer and Quality Assurance Tests . . . 91Adding More Tests . . . 92Chapter 5: Toward a Catalog of Refactorings . . . 97Format of the Refactorings . . . 97Finding References . . . 99Chapter 6: Composing Methods . . . 101Extract Method . . . 102Inline Method . . . 108Inline Temp . . . 110Replace Temp with Query. . . 111Replace Temp with Chain . . . 114Introduce Explaining Variable . . . 117Split Temporary Variable . . . 121Remove Assignments to Parameters . . . 124Replace Method with Method Object . . . 127Substitute Algorithm . . . 131Replace Loop with Collection Closure Method . . . 133Extract Surrounding Method . . . 135Introduce Class Annotation . . . 139Introduce Named Parameter . . . 142Remove Named Parameter . . . 147Remove Unused Default Parameter . . . 150Dynamic Method Definition . . . 152Replace Dynamic Receptor with Dynamic Method Definition . . . 158Isolate Dynamic Receptor . . . 160Move Eval from Runtime to Parse Time . . . 165Chapter 7: Moving Features Between Objects . . . 167Move Method . . . 167Move Field . . . 172Extract Class . . . 175Inline Class . . . 179Hide Delegate . . . 181Remove Middle Man . . . 185Chapter 8: Organizing Data . . . 187Self Encapsulate Field . . . 188Replace Data Value with Object . . . 191Change Value to Reference . . . 194Change Reference to Value . . . 198Replace Array with Object . . . 201Replace Hash with Object . . . 206Change Unidirectional Association to Bidirectional . . . 210Change Bidirectional Association to Unidirectional . . . 213Replace Magic Number with Symbolic Constant . . . 217Encapsulate Collection . . . 219Replace Record with Data Class . . . 224Replace Type Code with Polymorphism . . . 225Replace Type Code with Module Extension . . . 232Replace Type Code with State/Strategy . . . 239Replace Subclass with Fields . . . 251Lazily Initialized Attribute . . . 255Eagerly Initialized Attribute . . . 257Chapter 9: Simplifying Conditional Expressions . . . 261Decompose Conditional . . . 261Recompose Conditional . . . 264Consolidate Conditional Expression . . . 265Consolidate Duplicate Conditional Fragments . . . 268Remove Control Flag . . . 269Replace Nested Conditional with Guard Clauses . . . 274Replace Conditional with Polymorphism . . . 279Introduce Null Object . . . 284Introduce Assertion . . . 292Chapter 10: Making Method Calls Simpler . . . 297Rename Method . . . 298Add Parameter . . . 300Remove Parameter . . . 302Separate Query from Modifier . . . 303Parameterize Method . . . 307Replace Parameter with Explicit Methods . . . 310Preserve Whole Object . . . 313Replace Parameter with Method . . . 317Introduce Parameter Object . . . 320Remove Setting Method . . . 324Hide Method . . . 327Replace Constructor with Factory Method . . . 328Replace Error Code with Exception . . . 332Replace Exception with Test . . . 337Introduce Gateway . . . 341Introduce Expression Builder . . . 346Chapter 11: Dealing with Generalization . . . 353Pull Up Method . . . 353Push Down Method . . . 356Extract Module . . . 357Inline Module . . . 362Extract Subclass . . . 363Introduce Inheritance . . . 368Collapse Heirarchy . . . 371Form Template Method . . . 372Replace Inheritance with Delegation . . . 386Replace Delegation with Hierarchy . . . 389Replace Abstract Superclass with Module . . . 392Chapter 12: Big Refactorings . . . 397The Nature of the Game . . . 397Why Big Refactorings Are Important . . . 398Four Big Refactorings . . . 398Tease Apart Inheritance . . . 399Convert Procedural Design to Objects . . . 405Separate Domain from Presentation . . . 406Extract Hierarchy . . . 412Chapter 13: Putting It All Together . . . 417References . . . 421Index . . . 423
Series Title: Addison-Wesley professional Ruby series.
Responsibility: Jay Fields, Shane Harvie, Martin Fowler ; with Kent Beck.

Abstract:

Programmers can transform even the most chaotic software into well-designed systems that are far easier to evolve and maintain. What's more, they can do it through a series of simple, proven steps.  Read more...

Reviews

User-contributed reviews
Retrieving GoodReads reviews...
Retrieving DOGObooks reviews...

Tags

Be the first.
Confirm this request

You may have already requested this item. Please select Ok if you would like to proceed with this request anyway.

Linked Data


Primary Entity

<http://www.worldcat.org/oclc/234444821> # Refactoring
    a schema:Book, schema:CreativeWork ;
   library:oclcnum "234444821" ;
   library:placeOfPublication <http://experiment.worldcat.org/entity/work/data/3901261053#Place/upper_saddle_river_nj> ; # Upper Saddle River, NJ
   library:placeOfPublication <http://id.loc.gov/vocabulary/countries/nju> ;
   schema:about <http://dewey.info/class/005.117/e22/> ;
   schema:about <http://experiment.worldcat.org/entity/work/data/3901261053#Topic/ruby> ; # Ruby
   schema:about <http://id.worldcat.org/fast/1124216> ; # Software refactoring
   schema:about <http://experiment.worldcat.org/entity/work/data/3901261053#Topic/refactoring> ; # Refactoring
   schema:about <http://id.worldcat.org/fast/1101038> ; # Ruby (Computer program language)
   schema:bookEdition "Ruby ed." ;
   schema:bookFormat bgn:PrintBook ;
   schema:contributor <http://viaf.org/viaf/91054551> ; # Shane Harvie
   schema:contributor <http://viaf.org/viaf/5145169> ; # Martin Fowler
   schema:copyrightYear "2010" ;
   schema:creator <http://viaf.org/viaf/91054546> ; # Jay Fields
   schema:datePublished "2010" ;
   schema:description "The first refactoring guide specifically for Ruby - one of today's fastest growing programming languages Co-authored by Martin Fowler based on his legendary Refactoring, which started the refactoring revolution."@en ;
   schema:exampleOfWork <http://worldcat.org/entity/work/id/3901261053> ;
   schema:inLanguage "en" ;
   schema:isPartOf <http://experiment.worldcat.org/entity/work/data/3901261053#Series/addison_wesley_professional_ruby_series> ; # Addison-Wesley professional Ruby series.
   schema:name "Refactoring"@en ;
   schema:productID "234444821" ;
   schema:publication <http://www.worldcat.org/title/-/oclc/234444821#PublicationEvent/upper_saddle_river_nj_addison_wesley_2010> ;
   schema:publisher <http://experiment.worldcat.org/entity/work/data/3901261053#Agent/addison_wesley> ; # Addison-Wesley
   schema:url <http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=018968827&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA> ;
   schema:workExample <http://worldcat.org/isbn/9780321603500> ;
   schema:workExample <http://worldcat.org/isbn/9780321984135> ;
   umbel:isLike <http://bnb.data.bl.uk/id/resource/GBA9A0416> ;
   wdrs:describedby <http://www.worldcat.org/title/-/oclc/234444821> ;
    .


Related Entities

<http://experiment.worldcat.org/entity/work/data/3901261053#Place/upper_saddle_river_nj> # Upper Saddle River, NJ
    a schema:Place ;
   schema:name "Upper Saddle River, NJ" ;
    .

<http://experiment.worldcat.org/entity/work/data/3901261053#Series/addison_wesley_professional_ruby_series> # Addison-Wesley professional Ruby series.
    a bgn:PublicationSeries ;
   schema:hasPart <http://www.worldcat.org/oclc/234444821> ; # Refactoring
   schema:name "Addison-Wesley professional Ruby series." ;
   schema:name "Addison-Wesley professional Ruby series" ;
    .

<http://id.worldcat.org/fast/1101038> # Ruby (Computer program language)
    a schema:Intangible ;
   schema:name "Ruby (Computer program language)"@en ;
    .

<http://id.worldcat.org/fast/1124216> # Software refactoring
    a schema:Intangible ;
   schema:name "Software refactoring"@en ;
    .

<http://viaf.org/viaf/5145169> # Martin Fowler
    a schema:Person ;
   schema:birthDate "1963" ;
   schema:familyName "Fowler" ;
   schema:givenName "Martin" ;
   schema:name "Martin Fowler" ;
    .

<http://viaf.org/viaf/91054546> # Jay Fields
    a schema:Person ;
   schema:birthDate "1979" ;
   schema:familyName "Fields" ;
   schema:givenName "Jay" ;
   schema:name "Jay Fields" ;
    .

<http://viaf.org/viaf/91054551> # Shane Harvie
    a schema:Person ;
   schema:birthDate "1980" ;
   schema:familyName "Harvie" ;
   schema:givenName "Shane" ;
   schema:name "Shane Harvie" ;
    .

<http://worldcat.org/isbn/9780321603500>
    a schema:ProductModel ;
   schema:isbn "0321603508" ;
   schema:isbn "9780321603500" ;
    .

<http://worldcat.org/isbn/9780321984135>
    a schema:ProductModel ;
   schema:isbn "0321984137" ;
   schema:isbn "9780321984135" ;
    .


Content-negotiable representations

Close Window

Please sign in to WorldCat 

Don't have an account? You can easily create a free account.