Hide this

Results from Google Books

Click on a thumbnail to go to Google Books.

Refactoring: Improving the Design of…
Loading...

Refactoring: Improving the Design of Existing Code (original 1999; edition 1999)

by Martin Fowler

MembersReviewsPopularityAverage ratingMentions
1,255105,774 (4.38)3
Member:gchpaco
Title:Refactoring: Improving the Design of Existing Code
Authors:Martin Fowler
Info:Addison-Wesley Professional (1999), Edition: 1, Hardcover, 464 pages
Collections:Your library
Rating:*****
Tags:None

Work details

Refactoring: Improving the Design of Existing Code by Martin Fowler (1999)

None.

Loading...

Sign up for LibraryThing to find out whether you'll like this book.

English (8)  Russian (1)  Spanish (1)  All languages (10)
Showing 1-5 of 8 (next | show all)
Refactoring is the process of rewriting software, without changing the way it functions, in order to improve its readability, testability or maintanability. A book has been written on the subject by Martin Fowler. Some of the chapters were written by other people.

“Refactoring: Improving the Design of Existing Code” is focused on OO programming (lots of Java examples) and Agile practices. It is setup as a catalog of refactoring techniques. Each page dedicated to a refactoring is clearly marked, so that you can easily look up a refactoring.

The book was written a decade ago. At that time IDE’s did not support advanced refactorings. Most of the methods described are fully automated in modern IDE’s. This means that you don’t have to follow the text that closely any more.

1. Refactoring, a First Example

The first chapter starts with a simple example. Java code is used throughout the example as well as UML diagrams.

2. Principles in Refactoring

The Why and When of refactoring are discussed. Also we get instructions on what to tell our manager about refactoring. This seems a bit silly to me, since I have never had to explain refactoring to my managers.

3. Bad Smells in Code

“Code Smells” is a frequently used Agile phrase. A phrase I don’t care that much about. Code works or it doesn’t, it can be ugly or unreadable, but it doesn’t smell. The list of “smells” makes sense, however some of the names are downright confusing. For instance, would you be able to tell me what “Refused Bequest” means?

4. Building Tests

This chapter talks about JUnit at length. I am sure you are aware that there are many other unit testing frameworks for programming languages other than Java such as PyUnit. We are told that before you start refactoring, you need to have tests. I think it is more of a chicken/egg dilemma. Sometimes you need to refactor first in order to test. Unit tests and functional tests are mentioned. Integration tests, however are completely ignored. How would you know whether the performance and memory usage of your system remained the same? Clearly, this chapter was written by a software developer, and not by somebody who likes breaking applications, I mean testing applications.

5. Toward a Catalog of Refactorings

Chapter 5 describes the catalog of refactorings to follow. It is the catalog metada in a sense.

6. Composing methods

This chapter is the beginning of the catalog, which forms the “meat” of the book. I am just going to mention a few of the techniques listed in chapter 6.”Extract Method” is one of those refactorings I use on a daily basis. Sometimes things go wrong so we have to do the opposite refactoring “Inline Method”. The author starts using the term “temp” to mean temporary local variables.

7. Moving Features Between Objects

The author admits that he has trouble assigning responsibilities to objects. We are supposed to fix errors with “Move Method”, “Move Field”, “Extract Class” or other refactorings in this chapter.

8. Organizing Data

This chapter discusses a lot of different ways to simplify working with data. For instance, with these refactorings:

Replace Data Value with Object
Replace Array with Object

Also the refactoring “Replace Magic Number with Symbolic Constant” is explained a.k.a “Extract Constant”.

9. Simplifying Conditional Expressions

In my opinion the refactorings in this chapter need to be renamed. Apart from “Decompose Conditional”, which is clear enough. Although “Breaking up Conditional” might have been better.

10. Making Method Calls Simpler

Make method calls simpler by renaming them or replacing long parameter lists by objects. The latter technique could be a problem in concurrent programs. It is common to pass immutable values as parameters. You might not be able to replace them by immutable objects.

11. Dealing with Generalization

Generalization or in OO terms inheritance is a powerful mechanism, that tends to be overused a lot. You can push/pull a method or a field. Inheritance can be replaced by delegation and vice versa.

12. Big Refactorings

In this chapter starts what we can call the “dessert” part. No more simple refactoring recipes. Instead four refactorings that take a considerable amount of time.

13. Refactoring, Reuse and Reality

This chapter is an essay on Refactoring by William Opdyke.

14. Refactoring Tools

IDE’s have come a long way since this book was written. Most of the issues in this chapter are no longer valid.

15. Putting It All Together

This final chapter by Kent Beck is a bit mystical and vague. Those are his own words by the way. Some of the points make sense, but the chapter is written too much in a master talking to an apprentice style.

The book has a list of soundbites at the end. Literally. The fun thing is that you probably have heard or are going to hear a lot of these soundbites. “Refactoring” is a very useful book, albeit too focused on Java. Most recipes would work for another Object Oriented language. I give this book 5 stars out of 5. ( )
1 vote IvanIdris | Jan 22, 2012 |
This book literally changed overnight the way I write software. The author says we write code primarily for other humans, not for computers. I have heard it before, but this book made me believe it. It doesn't stop there; the author then walks you through exactly how to write code that is easier to read. Looking back at my own code, if it's hard to follow, it's from before I read this book. If it reads like a novel, it's from after. ( )
  momander | Oct 11, 2011 |
Very well laid out book. Although it's not a 'read cover to cover' book, the discussions and examples are easy to follow. The first few parts discuss how refactoring is applied and used. the second half, the bulk of the book, covers specific refactorings by category in a templated format. Good reference for those first approaching refactoring or those doing less familiar ones trying something. ( )
1 vote Murdocke23 | Jan 31, 2010 |
Want to know how to be a better software developer?: Then read this book - it contains great tips and hints for how to be a better developer by making your code (or someone else's code) more easily maintainable. For example
> Remove duplicated code
> Write smaller classes "Do one thing and do it well"
> Only expose methods that need to be exposed
> re-write complicated expressions by introducing temporary variables with names that explain the purpose
and so many others. Particularly great for those left maintaining code written by someone else who thought a class containing 2,500 lines of code is fine.
1 vote euang | Sep 1, 2008 |
Owner: TG
  transmissiongames | Jun 3, 2008 |
Showing 1-5 of 8 (next | show all)
no reviews | add a review
You must log in to edit Common Knowledge data.
For more help see the Common Knowledge help page.
Series (with order)
Canonical title
Original title
Alternative titles
Original publication date
People/Characters
Important places
Important events
Related movies
Awards and honors
Epigraph
Dedication
First words
Quotations
Last words
Disambiguation notice
Publisher's editors
Blurbers
Publisher series
Book description
Haiku summary

Amazon.com Amazon.com Review (ISBN 0201485672, Hardcover)

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.

(retrieved from Amazon Thu, 03 Jan 2013 07:33:20 -0500)

No library descriptions found.

Quick Links

Swap Ebooks Audio
120 wanted2 pay

Popular covers

Rating

Average: (4.38)
0.5
1
1.5
2 1
2.5 1
3 17
3.5 7
4 92
4.5 11
5 110

Penguin Australia

An edition of this book was published by Penguin Australia.

» Publisher information page

Is this you?

Become a LibraryThing Author.

 

Help/FAQs | About | Privacy/Terms | Blog | Contact | LibraryThing.com | APIs | WikiThing | Common Knowledge | Legacy Libraries | Early Reviewers | 82,564,634 books!