Refactoring to Patterns
- By Joshua Kerievsky
- Published Aug 5, 2004 by Addison-Wesley Professional. Part of the Addison-Wesley Signature Series (Fowler) series.
- Copyright 2005
- Dimensions: 7x9-1/4
- Pages: 400
- Edition: 1st
- ISBN-10: 0-321-21335-1
- ISBN-13: 978-0-321-21335-8
Register your product to gain access to bonus material or receive a coupon.
Product Author Bios
Joshua Kerievsky is the founder of Industrial Logic (http://industriallogic.com), a company specializing in Extreme Programming. Since 1988, Joshua has been a professional software developer, coach, and instructor for clients such as Bankers Trust, MTV, MBNA, Ansys, MDS Sciex, Nielsen Media Research, and Sun Microsystems. He speaks regularly at conferences, has written numerous articles, and contributed chapters to Extreme Programming Explored (Addison-Wesley, 2001) and Extreme Programming Perspectives (Addison-Wesley, 2002). Joshua lives with his wife and daughters in Berkeley, California.
In 1994, Design Patterns changed the landscape of object-oriented development by introducing classic solutions to recurring design problems. In 1999, Refactoring revolutionized design by introducing an effective process for improving code. With the highly anticipated Refactoring to Patterns, Joshua Kerievsky has changed our approach to design by forever uniting patterns with the evolutionary process of refactoring.
This book introduces the theory and practice of pattern-directed refactorings: sequences of low-level refactorings that allow designers to safely move designs to, towards, or away from pattern implementations. Using code from real-world projects, Kerievsky documents the thinking and steps underlying over two dozen pattern-based design transformations. Along the way he offers insights into pattern differences and how to implement patterns in the simplest possible ways.
- A catalog of twenty-seven pattern-directed refactorings, featuring real-world code examples
- Descriptions of twelve design smells that indicate the need for this book’s refactorings
- General information and new insights about patterns and refactoring
- Detailed implementation mechanics: how low-level refactorings are combined to implement high-level patterns
- Multiple ways to implement the same pattern—and when to use each
- Practical ways to get started even if you have little experience with patterns or refactoring
Refactoring to Patterns reflects three years of refinement and the insights of more than sixty software engineering thought leaders in the global patterns, refactoring, and agile development communities. Whether you’re focused on legacy or “greenfield” development, this book will make you a better software designer by helping you learn how to make important design changes safely and effectively.
Visit the Author's Web Site related to this title.
74 of 78 people found the following review helpful
A book I've been waiting for,
Amazon Verified Purchase(What's this?)
This review is from: Refactoring to Patterns (Hardcover)Kerievsky has done it. He has started to pull together anti-patterns (a.k.a. "bad smells"), refactorings, and patterns into one unified study. All three work well individually. Together, they make a powerful combination.
This isn't as rigorously analytic as the original Design Patterns book. I fully expect more theory-oriented writers to follow the trail blazed here. Instead, Kerievsky gives worked examples, in great detail. At every point, he starts with a code sample drawn from real life, complex enough to be interesting. Then, step by step, he shows the incremental changes made to transition from it's problematic start to its pattern-based end point. Experienced programmers may find this plodding and repetitive. Beginners, however, often have a hard time planning incremental changes and executing them. The author takes care to keep the code in working order at each increment, showing a clear path through the forest of possibilities. Some readers may even trace the path... Read more
46 of 49 people found the following review helpful
Wonderful! Brings patterns into coding, not just designing,
This review is from: Refactoring to Patterns (Hardcover)Based on its title alone I had high expectations for this book. It didn't disappoint. The book takes two of the most important advances of the past decade (patterns and refactoring) and puts them together into a whole that is definitely more than the sum of its parts.
I've read many good patterns books and have been applying patterns to how I think and talk about software since the original "Design Patterns" book in 1995. However, something was always missing. Through my consulting work, whenever I introduced patterns to a new team they would take quickly to the idea and patterns would become part of how they thought-but only when designing, not when coding. Since we spent more time coding than designing, patterns played less of a role than they could have.
This book does an excellent job of bringing patterns into coding, rather than relegating them just to design discussions. As the author points out, "patterns are best viewed in the light of refactoring and... Read more
53 of 59 people found the following review helpful
Over-complicated examples ruin a superb piece of work.,
This review is from: Refactoring to Patterns (Hardcover)This book is the only one of its kind that tries to use a patterns approach to refactoring. It is a good add-on to Martin Fowler's book. It's a very valuable contribution to the refactoring community. Kerievsky has a no-nonsense, down-to-earth approach to the subject of Patterns. However unlike Fowler who makes an effort to keep the code examples in his book as simple as possible, Kerievsky has made his examples over-complicated with all kinds of detailed finance domain references and the XML DOM. The example he uses to show how the Builder pattern simplifies creation of Composites is like a really heavy chapter on XML processing/generation.
The "Replace Conditional Logic with Strategy" is like a chapter on Investments / Loans. It really distracts the reader's attention from the pattern or refactoring.
This is a shame because it is impossible to write a good book on refactoring without nice examples. It is also a bit surprising that none of the other Amazon... Read more
› See all 49 customer reviews...
Online Sample Chapters
Table of Contents
Foreword by Ralph Johnson.
Foreword by Martin Fowler.
What Is This Book About?
What Are the Goals of This Book?
Who Should Read This Book?
What Background Do You Need?
How to Use This Book.
The History of This Book.
Standing on the Shoulders of Giants.
1. Why I Wrote This Book.
The Patterns Panacea.
Test-Driven Development and Continuous Refactoring.
Refactoring and Patterns.
What Is Refactoring?
What Motivates Us to Refactor?
Keeping It Clean.
Evolving a New Architecture.
Composite and Test-Driven Refactorings.
The Benefits of Composite Refactorings.
What Is a Pattern?
There Are Many Ways to Implement a Pattern.
Refactoring to, towards, and away from Patterns.
Do Patterns Make Code More Complex?
Up-Front Design with Patterns.
4. Code Smells.
Alternative Classes with Different Interfaces.
5. A Catalog of Refactorings to Patterns.
Format of the Refactorings.
Projects Referenced in This Catalog.
A Starting Point.
A Study Sequence.
Replace Constructors with Creation Methods.
Move Creation Knowledge to Factory.
Encapsulate Classes with Factory.
Introduce Polymorphic Creation with Factory Method.
Encapsulate Composite with Builder.
Replace Conditional Logic with Strategy.
Move Embellishment to Decorator.
Replace State-Altering Conditionals with State 166
Replace Implicit Tree with Composite.
Replace Conditional Dispatcher with Command.
Form Template Method.
Replace One/Many Distinctions with Composite.
Replace Hard-Coded Notifications with Observer.
Unify Interfaces with Adapter.
Replace Implicit Language with Interpreter.
Replace Type Code with Class.
Limit Instantiation with Singleton.
Move Accumulation to Collecting Parameter.
Move Accumulation to Visitor.
Afterword by John Brant and Don Roberts.
Downloadable Sample Chapter
Download the Sample
Chapter related to this title.
Download the Index
file related to this title.
Book + eBook Bundle
Book Price $51.99
eBook Price $18.20
eBook formats included
This book includes free shipping!
This book includes free shipping!
Includes EPUB, MOBI, and PDF
About eBook Formats
This eBook includes the following formats, accessible from your Account page after purchase:
EPUBThe open industry format known for its reflowable content and usability on supported mobile devices.
MOBIThe eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDFThe popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discretely watermarking it with your name, making it uniquely yours.
Get access to thousands of books and training videos about technology, professional development and digital media from more than 40 leading publishers, including Addison-Wesley, Prentice Hall, Cisco Press, IBM Press, O'Reilly Media, Wrox, Apress, and many more. If you continue your subscription after your 30-day trial, you can receive 30% off a monthly subscription to the Safari Library for up to 12 months. That's a total savings of $199.