Refactoring to Patterns (Addison-Wesley Signature Series)

by Addison-Wesley Professional

$59.99
buy from amazon.com
Average Rating: * * * * -
Sales Rank:131526 (lower is better)
Price Used:$33.00
Shipping:Free Shipping on most orders over $25*
Availability:Usually ships in 24 hours
Label:Addison-Wesley Professional
UPC:785342213355
Pages:400
Binding:Hardcover
Publication Date:2004-08-15
Published By:Addison-Wesley Professional
ASIN:0321213351
Category:Book

Authors

Editorial Reviews and Product Descriptions

Book Description

What Is This Book About?
This book is about the marriage of refactoring—the process of improving the design of existing code—with patterns, the classic solutions to recurring design problems. Refactoring to Patterns suggests that using patterns to improve an existing design is better than using patterns early in a new design. This is true whether code is years old or minutes old. We improve designs with patterns by applying sequences of low-level design transformations, known as refactorings.

What Are the Goals of This Book?
This book was written to help you:

Understand how to combine refactoring and patterns
Improve the design of existing code with pattern-directed refactorings
Identify areas of code in need of pattern-directed refactorings
Learn why using patterns to improve existing code is better than using patterns early in a new design
To achieve these goals, this book includes the following features:

A catalog of 27 refactorings
Examples based on real-world code, not the toy stuff
Pattern descriptions, including real-world pattern examples
A collection of smells (i.e., problems) that indicate the need for pattern-directed refactorings
Examples of different ways to implement the same pattern
Advice for when to refactor to, towards, or away from patterns
To help individuals or groups learn the 27 refactorings in the book, you’ll find a suggested study sequence on the inside back cover of the book.

Who Should Read This Book?

This book is for object-oriented programmers engaged in or interested in improving the design of existing code. Many of these programmers use patterns and/or practice refactoring but have never implemented patterns by refactoring; others know little about refactoring and patterns and would like to learn more.

This book is useful for both greenfield development, in which you are writing a new system or feature from scratch, and legacy development, in which you are mostly maintaining a legacy system.

What Background Do You Need?
This book assumes you are familiar with design concepts like tight coupling and loose coupling as well as object-oriented concepts like inheritance, polymorphism, encapsulation, composition, interfaces, abstract and concrete classes, abstract and static methods, and so forth.

I use Java examples in this book. I find that Java tends to be easy for most object-oriented programmers to read. I’ve gone out of my way to not use fancy Java features, so whether you code in C++, C#, Visual Basic .NET, Python, Ruby, Smalltalk, or some other object-oriented language, you ought to be able to understand the Java code in this book.

This book is closely tied to Martin Fowler’s classic book Refactoring F. It contains references to low-level refactorings, such as:

Extract Method
Extract Interface
Extract Superclass
Extract Subclass
Pull Up Method
Move Method
Rename Method

Refactoring also contains references to more sophisticated refactorings, such as:

Replace Inheritance with Delegation
Replace Conditional with Polymorphism
Replace Type Code with Subclasses

To understand the pattern-directed refactorings in this book, you don’t need to know every refactoring listed above. Instead, you can follow the example code that illustrates how the listed refactorings are implemented. However, if you want to get the most out of this book, I do recommend that you have Refactoring close by your side. It’s an invaluable refactoring resource, as well as a useful aid for understanding this book.

The patterns I write about come from the classic book Design Patterns DP, as well as from authors such as Kent Beck, Bobby Woolf, and myself. These are patterns that my colleagues and I have refactored to, towards, or away from on real-world projects. By learning the art of pattern-directed refactorings, you’ll understand how to refactor to, towards, or away from patterns not mentioned in this book.

You don’t need expert knowledge of these patterns to read this book, though some knowledge of patterns is useful. To help you understand the patterns I’ve written about, this book includes brief pattern summaries, UML sketches of patterns, and many example implementations of patterns. To get a more detailed understanding of the patterns, I recommend that you study this book in conjunction with the patterns literature I reference.

This book uses UML 2.0 diagrams. If you don’t know UML very well, you’re in good company. I know the basics. While writing this book, I kept the third edition of Fowler’s UML Distilled Fowler, UD close by my side and referred to it often.

Customer Reviews

Good ideas, but needs refactoring - Reviewed on 2008-02-21
* * *
1 customer found this review helpful.

There are a lot of nuggets of wisdom in the book, especially in the pragmatic approach the author takes to refactoring and patterns. He admits that patterns can make code worse, or better, depending on the need and skill of the author. He also provides a number of clear examples. However, the style of the book is like the dull works I had to read in graduate school, unnecessarily littered with citations. He cites Fowler to such an obscene degree that it looks more like academic backslapping. Citations are fine when doing a review of literature or examining research, but when they are used for mere quotations, the style is intrusive. As a final complaint, I found that I could often read a whole page and reduce it to one or two sentences. Curiously, he cites an example of Benjamin Franklin trimming a long phrase down to a single person's name. I wish he would have refactored the book in the same way. Almost all programming practices books suffer in the same way: dull, ungodly verbose, academic, and making unnecessary deviations from the point at hand. My suggestion is to get good at skimming, and you will find this book to be worthwhile.
The Joy of Clean Up Reaches the Design Level - Reviewed on 2008-01-15
* * * * *

Clean up (refactoring) is fun. Clean up to the design level (patterns) is stunning. A very pragmatic introduction, down to the code and incredibly helpful. Even strong procrastinators develop an appetite for this often little loved part of our work.

Now what are the prerequisites: You should have read and maybe even handy the landmark book "Refactoring" by Martin Fowler and colleagues. You need a working knowledge of design patterns. You have to actually like real code. Everything else is contained in this beautiful book.

The writing style is lucid and the topic is explained in a refactoring fashion: Readers are guided through the subject with real code (somewhat simplified) in small steps at a slow speed step by step. It is amazing how much ground you cover this way and how fast.

I do highly recommend this book for every software developer.
Combines Refactoring and Patterns - Reviewed on 2008-01-08
* * * * *

A master-piece and a must-read art-work. When I was studying on Martin Fowler's Refactoring to make my code more comprehensive and improve its clarification, I see, Martin Fowler's techiques are generalized techniques, I found Joshua Kerievsky's techiques in Refactoring to Patterns are more specific techiques concern of purely Design Patterns. While Design Patterns itself high-level abstracted, it is easy to find concrete examples in Recfactoring to Patterns and that makes programmer easy to understand Design Patterns. Special thanks to Joshua Kerievsky and to his study group for a this kind of work.
the best design pattern book - Reviewed on 2007-02-22
* * * * *
1 customer found this review helpful, 1 did not.

this is definitely the best book about design pattern I have ever read.

but this book is not telling you what a pattern is and how to use this pattern; instead, it shows some inappropriate designed structure and explains what might be the reason of the inappropriate design, then suggests one pattern to help you out. it's an excellent idea to describe a pattern and the samples are interesting.

moreover, the book is paperback, thin, small, easy to carry, what else can u ask for :D
Great book, get it if you do design. - Reviewed on 2007-02-06
* * * * *

Well done book, and a valuable next-step in learning about design patterns. The original GOF presents them in isolated and rather sterile format and manner, this book adds a much richer context and analysis in actually using them in application refactorings.
Read More Customer Reviews »
Go To Amazon Product Page

* - See Amazon Product Page for shipping and pricing details.


Book Subjects