or
Sign in to turn on 1-Click ordering.
 
 
Express Checkout with PayPhrase
What's this? | Create PayPhrase
More Buying Choices
62 used & new from $23.99

Have one to sell? Sell yours here
 
   
Refactoring: Improving the Design of Existing Code
 
 

Refactoring: Improving the Design of Existing Code (Hardcover)

~ (Author), (Author), John Brant (Author), William Opdyke (Author), Don Roberts (Author)
Key Phrases: move method, inline method, push down field, Extract Method, Replace Type Code, Rename Method (more...)
4.5 out of 5 stars  See all reviews (139 customer reviews)

List Price: $64.99
Price: $41.93 & this item ships for FREE with Super Saver Shipping. Details
You Save: $23.06 (35%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Tuesday, November 17? Choose One-Day Shipping at checkout. Details
39 new from $30.39 23 used from $23.99

Formats

Amazon Price New from Used from
  Kindle Edition, June 28, 1999 $33.54 -- --
  Hardcover, July 7, 1999 $41.93 $30.39 $23.99

Best Value

Buy Refactoring: Ruby Edition and get Refactoring: Improving the Design of Existing Code at an additional 5% off Amazon.com's everyday low price.

Refactoring: Ruby Edition + Refactoring: Improving the Design of Existing Code
Buy Together Today: $79.82

Show availability and shipping details

  • Refactoring: Ruby Edition

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • This item: Refactoring: Improving the Design of Existing Code

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details


Customers Who Bought This Item Also Bought

Test Driven Development: By Example

Test Driven Development: By Example

by Kent Beck
3.9 out of 5 stars (32)  $41.21
Refactoring to Patterns

Refactoring to Patterns

by Joshua Kerievsky
4.1 out of 5 stars (44)  $41.93
Design Patterns: Elements of Reusable Object-Oriented Software

Design Patterns: Elements of Reusable Object-Oriented Software

by Erich Gamma
4.5 out of 5 stars (265)  $35.93
Working Effectively with Legacy Code

Working Effectively with Legacy Code

by Michael C. Feathers
4.9 out of 5 stars (30)  $38.70
Patterns of Enterprise Application Architecture

Patterns of Enterprise Application Architecture

by Martin Fowler
4.5 out of 5 stars (62)  $45.15
Explore similar items

Editorial Reviews

Amazon.com Review

Your class library works, but could it be better? Refactoring: Improving the Design of Existing Code shows how refactoring can make object-oriented code simpler and easier to maintain. Today refactoring requires considerable design know-how, but once tools become available, all programmers should be able to improve their code using refactoring techniques.

Besides an introduction to refactoring, this handbook provides a catalog of dozens of tips for improving code. The best thing about Refactoring is its remarkably clear presentation, along with excellent nuts-and-bolts advice, from object expert Martin Fowler. The author is also an authority on software patterns and UML, and this experience helps make this a better book, one that should be immediately accessible to any intermediate or advanced object-oriented developer. (Just like patterns, each refactoring tip is presented with a simple name, a "motivation," and examples using Java and UML.)

Early chapters stress the importance of testing in successful refactoring. (When you improve code, you have to test to verify that it still works.) After the discussion on how to detect the "smell" of bad code, readers get to the heart of the book, its catalog of over 70 "refactorings"--tips for better and simpler class design. Each tip is illustrated with "before" and "after" code, along with an explanation. Later chapters provide a quick look at refactoring research.

Like software patterns, refactoring may be an idea whose time has come. This groundbreaking title will surely help bring refactoring to the programming mainstream. With its clear advice on a hot new topic, Refactoring is sure to be essential reading for anyone who writes or maintains object-oriented software. --Richard Dragan

Topics Covered: Refactoring, improving software code, redesign, design tips, patterns, unit testing, refactoring research, and tools.



Product Description

As the application of object technology-particularly the Java programming language-has become commonplace, a new problem has emerged to confront the software development community. Significant numbers of poorly designed programs have been created by less-experienced developers, resulting in applications that are inefficient and hard to maintain and extend. Increasingly, software system professionals are discovering just how difficult it is to work with these inherited, "non-optimal" applications. For several years, expert-level object programmers have employed a growing collection of techniques to improve the structural integrity and performance of such existing software programs. Referred to as "refactoring," these practices have remained in the domain of experts because no attempt has been made to transcribe the lore into a form that all developers could use. . .until now. In Refactoring: Improving the Design of Existing Software, renowned object technology mentor Martin Fowler breaks new ground, demystifying these master practices and demonstrating how software practitioners can realize the significant benefits of this new process.

With proper training a skilled system designer can take a bad design and rework it into well-designed, robust code. In this book, Martin Fowler shows you where opportunities for refactoring typically can be found, and how to go about reworking a bad design into a good one. Each refactoring step is simple-seemingly too simple to be worth doing. Refactoring may involve moving a field from one class to another, or pulling some code out of a method to turn it into its own method, or even pushing some code up or down a hierarchy. While these individual steps may seem elementary, the cumulative effect of such small changes can radically improve the design. Refactoring is a proven way to prevent software decay.

In addition to discussing the various techniques of refactoring, the author provides a detailed catalog of more than seventy proven refactorings with helpful pointers that teach you when to apply them; step-by-step instructions for applying each refactoring; and an example illustrating how the refactoring works. The illustrative examples are written in Java, but the ideas are applicable to any object-oriented programming language.


Product Details


More About the Authors

Discover books, learn about writers, read author blogs, and more.

Inside This Book (learn more)


What Do Customers Ultimately Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(6)

Your tags: Add your first tag
 

 

Customer Reviews

139 Reviews
5 star:
 (104)
4 star:
 (19)
3 star:
 (7)
2 star:
 (5)
1 star:
 (4)
 
 
 
 
 
Average Customer Review
4.5 out of 5 stars (139 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
129 of 135 people found the following review helpful:
4.0 out of 5 stars Recipes for improving code, May 5, 2000
Like the Gang of Four's landmark book _Design Patterns_, Fowler and his cohorts have created another catalog-style book, this time on refactoring.

Refactoring refers to taking existing, working software, and changing it about to improve its design, so that future modifications and enhancements are easier to add. _Refactoring_ is primarily a catalog of 70 or so different kinds of improvements you can make to object-oriented software.

Each entry in the catalog describes an implementation problem, the solution, motivation for applying the solution, the mechanics of the refactoring, and examples. The book's examples are all in Java, but C++ programmers should be able to approach the refactorings with ease. Often, Fowler diagrams the refactorings in UML, so a little Unified Modeling Language experience will help, too.

While the catalog is nice, the kinds of refactorings are obvious is most cases. Even moderately experienced programmers won't need the step-by-step mechanics described. The real benefit, though, is that the mechanics of each refactoring help guarantee that you can pull off the refactoring without introducing new bugs or side effects. They encourage you to take smaller, verifiable steps, than the more gross refactorings that most developers would naturally take. You actually save time doing so.

How do you know your refactorings are safe? Unit testing is the answer that Fowler et al. provide. Java developers will find the introduction to the Junit Testing Framework the most valuable part of the book, more so than the catalog of refactorings itself.

There's more to the book than the catalog and Junit, of course. There's discussion of the history of refactoring, how to evaluate refactoring tools, and how to convince management that what appears to be an overhead activity is actually useful in the long run.

Unfortunately, these sections are all too brief. And there is no discussion of how refactoring fits in with various software development processes. For example, programmers using Extreme Programming (XP) would probably feel right at home with Fowler's recommendations of refactoring in duets and unit testing, but developers stuck with a Software Engineering Institute process like PSP categorize testing as failure time and something to be minimized if not avoided. Cleanroom developers are taught that unit testing inteferes with metrics for quality, and that verifications are what should be done. Should such developers redo verifications after each refactoring? There's no answer in this book.

An unusual chapter, called "Bad Smells in Code," gives overall motivation for the refactorings. These vague notions, such as "long methods" or "lazy classes" humorously provide a foundation for starting your own refactorings. I say "humorously" because (mostly) Beck's and Fowler's odd analogies (classes becoming too intimate and delving in each others' private parts) provoke a chuckle (as if a chapter about "bad smells" in code weren't enough).

Overall, I've enjoyed reading this book and referring to the catalog while putting my own unit tests and refactorings into practice. Fowler's writing style is smooth and fluid, and it's easy to digest the catalog in no time. The book's typesetting is crisp, the figures quite clean, and both the refactoring index and "smell" index are enormously useful.

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
92 of 100 people found the following review helpful:
5.0 out of 5 stars Refactoring: Improving the Design of Existing Code, November 11, 2002
By Christopher Taylor "aspmatrix" (Gilbert, AZ United States) - See all my reviews
(REAL NAME)   
A little while back I was introduced to a word I had never heard before, Refactoring. I was told to
get Martin Fowler's book and read it so I could gain a better understanding of what Refactoring
was. Well folks, I would classify this book as a 'Hidden Treasure'.

Although it is not a flashy or well known title, I believe its impact can be much deeper and long
lasting than many of the mainstream, more popular technology books. The underlying theories
that it teaches can be applied for years, even when languages change.

There are only a couple of things I would change about this book, which I will mention below.

Preface
The Preface it brief enough, and gives the definition for the word Refactoring. This is a good thing
because right form the start you get the true definition of Refactoring. In short, refactoring is the
process of changing code to improve the internal structure, but not changing the external
behavior.

Chapter 1: Refactoring, a First Example

In this chapter Mr. Fowler tries to start by showing a simple Refactoring example. The problem is
that the chapter then goes on for 50+ pages. Mr. Fowler explains his reasons for doing this, but I
think that a simple example should have been much simpler. Especially when it is in the first
chapter of the book. It's not that this isn't a good chapter. I feel it's just too soon in the book. I
would have put it at the end.

Chapter 2: Principles of Refactoring
This is an excellent chapter. The definition of Refactoring is discussed as well as the following
questions: Why should you refactor? When should you refactor? What do I tell my manager? This
last question may seem funny, but when you read this chapter you will understand why it is in
there. This chapter also discusses common problems that occur during Refactoring, and
Refactoring and performance.

Chapter 3: Bad Smells in Code
In this chapter things that cause code to 'smell' are discussed. When code 'smells' it could be an
indicator that refactoring is needed. 22 different 'smells' are discussed. My favorites were
Duplicated Code, Large Class, and Lazy Class. This is a chapter full of awesome hints.

Chapter 4: Building Tests
Building tests is an important part refactoring. Refactoring is done in small steps, and after every
step you should test. In this chapter the discussion covers the processes and methodology of
applying tests during refactoring.

Chapter 5: Toward a Catalog of Refactorings
This chapter is a quick setup for chapters 6 to 12. Mr. Fowler explains his method for cataloging
the individual refactorings. What is pretty amazing is that he has taken a lot of time naming and
detailing each refactoring.

Chapter 6: Composing Methods
One of my favorite chapters. Mr. Fowler opens by saying, "A large part of my refactoring is
composing methods to package code properly." This chapter is all about that. 9 total refactorings
are explained. My favorite ones are Inline Method and Extract Method.

Chapter 7: Moving Features Between Objects
Sometimes you need to move things from one object to another. This chapter discusses the art of
moving features between objects. 8 total refactorings are discussed and detailed. My favorite
from this chapter is Extract Class.

Chapter 8: Organizing Data
A very large chapter that discusses in meticulous detail 16 refactorings that will make it much
easier to work with data. One thing that becomes very obvious in this chapter is that certain
refactorings can go either way. What I mean is illustrated by these two: Change Value to
Reference and Change Reference to Value. So some refactorings are not just one way deals. It
just depends on the situation.

Chapter 9: Simplifying Conditional Expressions
This is a very useful chapter since conditional logic is a common occurrence in the programming
world. Because conditional logic has a tendency to get very complex, this chapter has 8
refactorings that will help you simplify things.

Chapter 10: Making Method Calls Simpler
The 15 refactorings in this chapter help teach us how to make method calls easier to deal with.
They range from the very simple Rename Method to the more complex Replace Constructor with
Factory Method.

Chapter 11: Dealing with Generalization
Here are 12 refactorings dealing with the situations that arise from generalization. Inheritance,
Delegation, and Interfaces are some of the topics discussed.

Chapter 12: Big Refactorings
Kent Beck co-wrote this chapter with Mr. Fowler. They discuss what they call the 4 Big
Refactorings: Tease Apart Inheritance, Convert Procedural Design to Objects, Separate Domain
from Presentation, and Extract Hierarchy. These refactorings are of a more all-encompassing
type than the smaller individual refactorings from the preceding chapters. The co-authors do a
great job at putting in a nutshell what would normally take very long explanations.

Chapter 13: Refactoring, Reuse, and Reality
William Opdyke writes this chapter. He discusses his experiences with refactoring as well as
other subjects like why developers are reluctant to refactor and reducing the overhead of
refactoring. This chapter is an excellent 'putting it all together' chapter, and really helps put into
perspective the ideas that the book teaches.

Chapter 14: Refactoring Tools
Don Roberts and John Brant co-author this chapter. They discuss, as the chapter title would
indicate, refactoring tools.

Chapter 15: Putting It All Together
Kent Beck gives a quick 4-page wrap up.

One other thing I would change about the book is that I would want there to be examples in other
languages besides Java. I have practically no Java skills. For me the book would have been an
easier and faster read if it would have had examples in VB.net. Fortunately I understand enough
to get the idea of what is being taught, and that is the most important point.

Well as I said above, this book is really what I would consider a 'hidden treasure'. The things
discussed will help many people write better, more understandable code for years to come. I
would give it a 9.5 out of 10. It is well worth the {price}

Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
32 of 35 people found the following review helpful:
5.0 out of 5 stars Don't just read it - buy it, July 18, 2000
By Daniel Moth (Seattle, WA) - See all my reviews
(REAL NAME)   
One can read good books on a specific technology (COM, UML etc) or on specific programming languages or even on different approaches to software development (RUP, OPEN etc) but every now and then a true classic comes along. Like Design Patterns 4 years ago now refactoring comes along. Every serious OO developer should own both of these books. Get your hands on Refactoring if only to read chapter 3, which summarises all the 'bad smells' that may creep into code. 21 generic examples of what is bad programming and why. The remainder of the book describes numerous techniques (refactorings) for changing existing code in order to remove the 'smell'. Most refactorings are accompanied with some UML, which should be enough to get the idea, and they are then further described in Java. What makes this great a book is that it can be used as a reference very easily since its design was well thought out for this purpose with a comprehensive index and tables matching smells and respective refactorings. If any of this rings a bell to CODE COMPLETE readers it should cause the ideas are very similar but very much updated here. Fowler's writing style makes once again for easy, pleasant reading. Unreservedly recommended.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

5.0 out of 5 stars Great Mentoring...
I learned many things from this book. After reading, I felt like that I had received years of mentoring from an experienced professional. Read more
Published 2 months ago by A. Berlin

4.0 out of 5 stars Good resource for teaching
What is better? Replacing delegations with inheritance or replacing inheritance with delegation?

The answer is the ultimate answer to most software engineering... Read more
Published 17 months ago by Marcos Kalinowski

5.0 out of 5 stars Must have in any developers collection
I was referred to this book from a colleague after a quick discussion on "Replace temp with Query" in our projects code base. Read more
Published 18 months ago by Mr. Trevor Ings

4.0 out of 5 stars Refactoring
Refactoring 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. Read more
Published 20 months ago by Maxim Masiutin

4.0 out of 5 stars An Easy Read - Lots of Great Info - Must for New Programmers
This book is just a real easy read, with lots of good information. You can pretty much flip to any page in the book, read, and learn something. Read more
Published 22 months ago by Rhode Island Ready

5.0 out of 5 stars A must read for any serious developer.
This book is required reading for anyone who is serious about software development. If you want to go from good to great then do yourself a favor and get this book.
Published 24 months ago by D. Long

1.0 out of 5 stars Refactoring is needed on the book
I agree mainly with all the comments below 3 stars. The book could be "refactored" in less than 50 pages. I am also surprised with the high ratings of the book. Read more
Published on November 13, 2007 by Marc Magrans De Abril

5.0 out of 5 stars Great Read
I was in a situation where I had to mentor some junior developers overseas on a month long refactoring effort. Read more
Published on October 30, 2007 by Saiko

5.0 out of 5 stars Refactoring
... An outstanding guide for those wishing to learn more about software design and development. Highly recommended!!!
Published on October 8, 2007 by NGUYEN NGOC Anh Vu

5.0 out of 5 stars Most Useful for People engaged in Post Imp Environments
This is the most practical book for people involved in Post release / production support projects still reporting bugs and in dire need of refactoring. Read more
Published on April 25, 2007 by Anirudh

Only search this product's reviews



Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Discussion Replies Latest Post
Anyone need psychology testbook- trying to sell a used copy 2 1 hour ago
textbook scam 72 4 hours ago
Textbooks for Kindle DX? 61 6 days ago
Search Customer Discussions
Search all Amazon discussions
   


Listmania!



Product Information from the Amapedia Community

Beta (What's this?)


Look for Similar Items by Category


Look for Similar Items by Subject

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Your Recent History

 (What's this?)

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.