Refactoring: Improving the Design of Existing Code

Refactoring: Improving the Design of Existing Code
by Don Roberts, John Brant, Kent Beck, Martin Fowler, William Opdyke

Refactoring: Improving the Design of Existing Code
List Price: $64.99
Our Price: $42.85
You Save: $22.14 (34%)
Availability: Usually ships in 1-2 business days
Buy Used: from $25.00 (click here)
Category: Book
See more book details and other editions


or

Book Summary Information

Author: Don Roberts, John Brant, Kent Beck, Martin Fowler, William Opdyke
Edition: Hardcover
Audio: English (Unknown); English (Original Language); English (Published)
Published: 1999-07-08
ISBN: 0201485672
Number of pages: 464
Publisher: Addison-Wesley Professional
Accessories:

Book Reviews of Refactoring: Improving the Design of Existing Code

Book Review: Refactoring: Improving the Design of Existing Code
Summary: 5 Stars

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}

Summary of Refactoring: Improving the Design of Existing Code

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.
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.

Design Tools & Techniques Books

Book Subjects
Most talked about in Design Tools & Techniques Books
CMMI®: Guidelines for Process Integration and Product Improvement (2nd Edition) ImageCMMIŽ: Guidelines for Process Integration and Product Improvement (2nd Edition)
by Mary Beth Chrissis, Mike Konrad, Sandra Shrum
Addison-Wesley Professional; Published: 2006-11-23; Hardcover; Book
Best price: $10.36
Price in other shops: $69.99
An Assessment of Space Shuttle Flight Software Development Processes ImageAn Assessment of Space Shuttle Flight Software Development Processes
by Committee for Review of Oversight Mechanisms for Space Shuttle Flight Software Processes, Aeronautics and Space Engineering Board, National Research Council
National Academies Press; Published: 1993-01-01; Paperback; Book
Best price: $35.00
Automating Software Design ImageAutomating Software Design
The MIT Press; Published: 1991-12-26; Paperback; Book
Price in other shops: $35.00
Pattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems ImagePattern-Oriented Analysis and Design: Composing Patterns to Design Software Systems
by Sherif M. Yacoub, Hany H. Ammar, Sherif Yacoub, Hany Ammar
Addison-Wesley Professional; Published: 2003-08-15; Hardcover; Book
Best price: $64.90
Delphi Component Design ImageDelphi Component Design
by Danny Thorpe
Addison-Wesley (C); Published: 1996-12; Paperback; Book
Price in other shops: $36.95
Compiler Design (International Computer Science Series) ImageCompiler Design (International Computer Science Series)
by Renhard Wilhelm, Dieter Maurer
Longman Group United Kingdom; Published: 1995-03-01; Hardcover; Book
Best price: $254.49
Mastering the Requirements Process ImageMastering the Requirements Process
by Suzanne Robertson, James Robertson
Addison-Wesley Professional; Published: 1999-08-12; Hardcover; Book
Best price: $6.82
Price in other shops: $52.99
Software Design and Data Structures in Turbo PASCAL ImageSoftware Design and Data Structures in Turbo PASCAL
by Elliot B. Koffman, Bruce B. Maxim
Addison Wesley Publishing Company; Published: 2000-06; Paperback; Book
Best price: $56.00
An Introduction to Algorithm Design and Structured Programming ImageAn Introduction to Algorithm Design and Structured Programming
by Thomas A. Reed
Prentice Hall; Published: 1988-10; Hardcover; Book
Best price: $23.16
Price in other shops: $38.60
The Design Development and Evaluation of Instructional Software ImageThe Design Development and Evaluation of Instructional Software
by Michael J. Hannafin, Kyle L. Peck
Mac; Published: 1988; Paperback; Book
Best price: $32.49
Price in other shops: $100.40
Similar Books and other products
The Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition) ImageThe Mythical Man-Month: Essays on Software Engineering, Anniversary Edition (2nd Edition)
by Frederick P. Brooks
Addison-Wesley Professional; Published: 1995-08-12; Paperback; Book
Best price: $21.47
Price in other shops: $39.99
Patterns of Enterprise Application Architecture ImagePatterns of Enterprise Application Architecture
by Martin Fowler
Addison-Wesley Professional; Published: 2002-11-15; Hardcover; Book
Best price: $40.00
Price in other shops: $69.99
Effective Java (2nd Edition) ImageEffective Java (2nd Edition)
by Joshua Bloch
Addison-Wesley; Published: 2008-05-28; Paperback; Book
Best price: $28.89
Price in other shops: $54.99
Working Effectively with Legacy Code ImageWorking Effectively with Legacy Code
by Michael Feathers
Prentice Hall; Published: 2004-10-02; Paperback; Book
Best price: $38.33
Price in other shops: $59.99
Test Driven Development: By Example ImageTest Driven Development: By Example
by Kent Beck
Addison-Wesley Professional; Published: 2002-11-18; Paperback; Book
Best price: $28.04
Price in other shops: $49.99
The Pragmatic Programmer: From Journeyman to Master ImageThe Pragmatic Programmer: From Journeyman to Master
by Andrew Hunt, David Thomas
Addison-Wesley Professional; Published: 1999-10-30; Paperback; Book
Best price: $34.95
Price in other shops: $49.99
Head First Design Patterns ImageHead First Design Patterns
by Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra, Elisabeth Robson
O'Reilly Media; Published: 2004-11-01; Paperback; Book
Best price: $24.00
Price in other shops: $49.99
Clean Code: A Handbook of Agile Software Craftsmanship ImageClean Code: A Handbook of Agile Software Craftsmanship
by Robert C. Martin
Prentice Hall; Published: 2008-08-11; Paperback; Book
Best price: $32.89
Price in other shops: $49.99
Design Patterns: Elements of Reusable Object-Oriented Software ImageDesign Patterns: Elements of Reusable Object-Oriented Software
by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
Addison-Wesley Professional; Published: 1994-11-10; Hardcover; Book
Best price: $35.45
Price in other shops: $59.99
Code Complete: A Practical Handbook of Software Construction ImageCode Complete: A Practical Handbook of Software Construction
by Steve McConnell
Microsoft; Microsoft Press; Published: 2004-07-07; Paperback; Book
Best price: $27.54
Price in other shops: $49.99