Buy New
-
To see product details, add this item to your cart.
Ships from: Addas LLC Sold by: Addas LLC
Used - Very Good
-
To see product details, add this item to your cart.
Ships from: 2nd Life Books Sold by: 2nd Life Books
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
Refactoring to Patterns (Addison Wesley Signature Series)
Purchase options and add-ons
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.
Coverage includes:
- 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.
- Print length367 pages
- LanguageEnglish
- PublisherAddison-Wesley Professional
- Publication dateAugust 15, 2004
- Dimensions7.25 x 1.25 x 9.5 inches
- ISBN-100321213351
- ISBN-13978-0321213358
Book recommendations, author interviews, editors' picks, and more. Read it now
Frequently bought together

Customers who viewed this item also viewed
- Refactoring: Improving the Design of Existing Code (2nd Edition) (Addison-Wesley Signature Series (Fowler))HardcoverFREE Shipping by AmazonGet it as soon as Sunday, Oct 4
- Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Addison-Wesley Signature Series (Fowler))HardcoverFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Tuesday, Oct 6Only 1 left in stock - order soon.
- The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition)David ThomasHardcoverFREE Shipping by AmazonGet it as soon as Sunday, Oct 4
- Refactoring Databases: Evolutionary Database Design (Addison-Wesley Signature Series (Fowler))PaperbackFREE ShippingGet it Oct 15 - 22Usually ships within 6 to 7 days
- A Philosophy of Software Design, 2nd EditionPaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Sunday, Oct 4
Customers also bought or read
- Design Patterns: Elements of Reusable Object-Oriented Software
Hardcover$23.97$23.97Delivery Sun, Oct 4 - Test Driven Development: By Example (Addison-Wesley Signature Series (Beck))
Paperback$44.95$44.95FREE delivery Mon, Oct 5 - Clean Architecture: A Craftsman's Guide to Software Structure and Design (Robert C. Martin Series)
Paperback$30.29$30.29Delivery Sun, Oct 4 - Domain-Driven Design: Tackling Complexity in the Heart of Software
Hardcover$50.15$50.15FREE delivery Oct 11 - 13 - Extreme Programming Explained: Embrace Change, 2nd Edition (The XP Series)
Paperback$34.10$34.10Delivery Oct 10 - 14 - Growing Object-Oriented Software, Guided by Tests (Addison-Wesley Signature Series (Beck))
Paperback$36.60$36.60FREE delivery Tue, Oct 6 - Software Architecture: The Hard Parts: Modern Trade-Off Analyses for Distributed Architectures
Paperback$43.99$43.99FREE delivery Sun, Oct 4 - Clean Code: A Handbook of Agile Software Craftsmanship
Paperback$22.88$22.88$5.99 delivery Oct 9 - 14 - A Philosophy of Software Design, 2nd Edition#1 Best SellerComputer Systems Analysis & Design
Paperback$19.97$19.97Delivery Sun, Oct 4 - The Pragmatic Programmer: Your Journey To Mastery, 20th Anniversary Edition (2nd Edition)
Hardcover$45.97$45.97FREE delivery Sun, Oct 4 - Modern Software Engineering: Doing What Works to Build Better Software Faster
Paperback$39.99$39.99FREE delivery Sun, Oct 4 - Software Craftsman, The: Professionalism, Pragmatism, Pride (Robert C. Martin Series)
Paperback$42.40$42.40FREE delivery Oct 6 - 9 - Refactoring: Improving the Design of Existing Code (Addison-wesley Object Technology Series)
Hardcover$20.40$20.40FREE delivery Oct 5 - 7 - Head First Design Patterns: Building Extensible and Maintainable Object-Oriented Software 2nd Edition
Paperback$30.68$30.68Delivery Sun, Oct 4 - Code That Fits in Your Head: Heuristics for Software Engineering (Robert C. Martin Series)
Paperback$33.96$33.96Delivery Sun, Oct 4 - Implementation Patterns (Addison-Wesley Signature Series (Beck))
Paperback$35.34$35.34FREE delivery Sun, Oct 4 - Fundamentals of Software Architecture: A Modern Engineering Approach#1 Best SellerComputer Programming Logic
Paperback$52.40$52.40FREE delivery Sun, Oct 4 - Mythical Man-Month, The: Essays on Software Engineering, Anniversary Edition
Paperback$25.50$25.50Delivery Sun, Oct 4 - C++ Software Design: Design Principles and Patterns for High-Quality Software
Paperback$51.24$51.24FREE delivery Sun, Oct 4 - Specification by Example: How Successful Teams Deliver the Right Software
Paperback$56.42$56.42FREE delivery Sun, Oct 4 - Learning Domain-Driven Design: Aligning Software Architecture and Business Strategy
Paperback$37.49$37.49FREE delivery Sun, Oct 4 - Vibe Coding: Building Production-Grade Software With GenAI, Chat, Agents, and Beyond
Paperback$20.46$20.46Delivery Sun, Oct 4 - Data-oriented design: software engineering for limited resources and short schedules
Paperback$34.95$34.95Delivery Sun, Oct 4 - Effective C++: 55 Specific Ways to Improve Your Programs and Designs (Addison-Wesley Professional Computing Series)
Paperback$24.15$24.15Delivery Sun, Oct 4 - Implementing Lean Software Development: From Concept to Cash (Addison-Wesley Signature Series (Beck))
Paperback$14.00$14.00Delivery Sun, Oct 4 - Build a Large Language Model (From Scratch)#1 Best SellerPython Programming
Paperback$49.24$49.24FREE delivery Sun, Oct 4
Editorial Reviews
From the Publisher
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.
Coverage includes:
A catalog of twenty-seven pattern-directed refactorings, featuring real-world code examples
Descriptions of twelve design smells that indicate the need for this books 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 patternand 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 youre 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.
From the Back Cover
"For refactoring to be valuable it must be going somewhere, not just an abstract intellectual exercise. Patterns document program structures with known good properties. Put the two together and you have Refactoring to Patterns." Kent Beck, Director, Three Rivers Institute
"In the GoF book we claimed that design patterns are targets for refactorings. This book finally shows that we didn't lie. By doing so, Joshua's book will deepen your understanding of both refactoring and design patterns." Erich Gamma, Eclipse Java Development Tools lead, IBM
"Refactoring to patterns is a revolutionary approach to applying patterns that combines the top-down utility of design patterns with the bottom-up discovery of iterative development and continuous refactoring. Any serious software developer should be using this approach to discover new opportunities to use patterns to improve their code." Bobby Woolf, Consulting I/T Specialist, IBM Software Services for Web- Sphere, and coauthor of Enterprise Integration Patterns (Addison-Wesley) and The Design Patterns Smalltalk Companion (Addison-Wesley).
"With this unique catalog of design-level refactorings Joshua Kerievsky has given refactoring an entirely new dimension. Refactoring to Patterns shows developers how to make design-level improvements that simplify everyday work. This book is an invaluable reference for the refactoring practitioner." Sven Gorts
"This book refactors and restructures GoF, and much more. Refactoring to Patterns takes a subject that has been presented as static and rigid and makes it dynamic and flexible, converting it into a human process with experiments, mistakes, and corrections so you understand that good designs do not occur by turning some series of cranks--they evolve through struggle and reflection. Kerievsky has also restructured the presentation to make it far clearer and easier to assimilate. Indeed, he has solved a number of the organization problems that I have struggled with in Thinking in Patterns. This book is a clear introduction and combination of the disciplines of testing, refactoring, and patterns, and it is filled with easy reading, good sense, and great insights." Bruce Eckel, President of Mindview, Inc., and author of Thinking in Java/Thinking in C++ (Prentice Hall)
"The first time I met Joshua, I was struck by the depth of his passion for understanding, applying, and teaching design patterns. Great teachers care deeply about their subject and how to share it. I think Joshua is a great teacher--and developer--and that we can all benefit from his insight." Craig Larman, Chief Scientist, Valtech, and author of Applying UML and Patterns, Second Edition (Prentice Hall) and Agile and Iterative Development (Addison-Wesley)
"Refactoring to Patterns is important not only because it provides step-by-step instructions on how to improve your code through the methodical introduction of appropriate patterns, but more so because it teaches the principles that underlie the design patterns implemented. This book should be useful for novice and expert designers alike. This is a great book." Kyle Brown, IBM Software Services for WebSphere, and author of Enterprise Java™ Programming with IBM® WebSphere®, Second Edition (Addison-Wesley)
"Mastering a trade means more than just having the right tools--you also need to use them effectively. Refactoring to Patterns explains how to wield industrial-strength design tools with the skills of an artist." Russ Rufer, Silicon Valley Patterns Group
"Josh uses patterns to guide the small steps of refactoring toward larger goals and uses refactoring to introduce patterns into your code as it evolves. You'll learn how to make large improvements to existing code incrementally, rather than trying to force-fit a prefabricated solution. As the code changes you'll go beyond seeing better designs--you'll experience them." Phil Goodwin, Silicon Valley Patterns Group
"Now the connection between software patterns and agile development is finally told." Ward Cunningham
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.
Coverage includes:
- 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 importa and effectively.
About the Author
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.
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 toExtreme Programming Explored (Addison-Wesley, 2001) and Extreme Programming Perspectives (Addison-Wesley, 2002). Joshua lives with his wife and daughters in Berkeley, California.
Excerpt. © Reprinted by permission. All rights reserved.
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.
How to Use This Book
To get a high-level understanding of the refactorings in this book, you can begin by studying each refactoring’s summary (see Format of the Refactorings, 47), as well as its Benefits and Liabilities box, which appears at the end of each refactoring’s Motivation section.
To get a deeper understanding of the refactorings, you’ll want to study every part of a refactoring, with the exception of the Mechanics section. The Mechanics section is special. It’s intended to help you implement a refactoring by suggesting what low-level refactorings to follow. To understand a refactoring in this book, you don’t have to read the Mechanics section. You’re more likely to use the Mechanics section as a reference when you’re actually refactoring.
The coding smells described in this book and in Refactoring F provide a useful way to identify a design problem and find associated refactorings to help fix the problem. You can also scan the alphabetized listing of refactorings (on the inside covers of this book and Refactoring ) to find a refactoring that can help improve a design.
This book documents the refactorings that take a design either to, towards, or away from a pattern. To help you figure out what direction to go in, you’ll find a section on this subject (called Refactoring to, towards, and away from Patterns, 29) as well as a table (listed on the inside front cover) that shows each pattern name and the refactorings you can apply to take a design to, towards, or away from the pattern.
The History of This Book
I began writing this book sometime in 1999. At the time, there were several forces driving me to write about patterns, refactoring, and extreme programming (XP) Beck, XP. First, I was surprised that patterns had not been mentioned in the XP literature. This led me to write a paper called “Patterns & XP” Kerievsky, PXP in which I publicly discussed the subject and offered some suggestions on how to integrate these two great contributions to our field.
Second, I knew that Martin Fowler had included only a few refactorings to patterns in Refactoring F, and he clearly stated that he hoped someone would write more. That seemed like a worthwhile goal.
Finally, I noticed that people in The Design Patterns Workshop, a class that my colleagues and I teach, needed more help in figuring out when to actually apply a pattern to a design. It’s one thing to learn what a pattern is and an altogether different thing to really understand when and how to apply the pattern. I thought that these students needed to study real-world examples of cases where applying a pattern to a design makes sense, and thus I began compiling a catalog of such examples.
As soon as I began writing this book, I followed Bruce Eckel’s lead and placed my rather rough contents on the Web to obtain feedback. The Web is indeed a beautiful thing. Many folks responded with suggestions, encouragement, and appreciation.
As my writings and ideas matured, I began presenting the subject of Refactoring to Patterns in conference tutorials and during Industrial Logic’s intensive patterns and refactoring workshops. This led to more suggestions for improvement and many ideas on what programmers needed to understand this subject.
Gradually I came to see that patterns are best viewed in the light of refactoring and that they are destinations best reached by applying sequences of lowlevel refactorings.
When my writings began to resemble a book, rather than a long paper, I was fortunate enough to have many experienced practitioners review my work and offer suggestions for improvement. You can read more about these folks in the Acknowledgments section.
Standing on the Shoulders of Giants
In the summer of 1995, I walked into a bookstore, encountered the book Design Patterns DP for the first time, and fell in love with patterns. I wish to thank the authors, Erich Gamma, Richard Helm (whom I still haven’t met), Ralph Johnson, and John Vlissides for writing such an excellent piece of literature. The wisdom you shared in your book has helped me become a much better software designer.
Somewhere around 1996, before he became famous, I met Martin Fowler at a patterns conference. It was to be the beginning of a long friendship. I doubt whether I would have written this book if Martin (and his colleagues, Kent Beck, William Opdyke, John Brant, and Don Roberts) had not written the classic book Refactoring F. Like Design Patterns, Refactoring utterly changed the way I approach software design.
My writings in this book could only have happened because of the hard work of the authors of Design Patterns and Refactoring. I can’t thank you all enough for your great books.
Product details
- Publisher : Addison-Wesley Professional
- Publication date : August 15, 2004
- Edition : 1st
- Language : English
- Print length : 367 pages
- ISBN-10 : 0321213351
- ISBN-13 : 978-0321213358
- Item Weight : 2.1 pounds
- Dimensions : 7.25 x 1.25 x 9.5 inches
- Part of series : Addison-Wesley Signatures (Fowler)
- Best Sellers Rank: #849,596 in Books (See Top 100 in Books)
- #232 in Object-Oriented Design
- Customer Reviews:
About the author

Joshua is founder and CEO of Industrial Logic, one of the oldest and most well-respected agile consultancies in the world. Since 1996, Joshua and his global team of lean and agile experts have helped people in many industries leverage the wisdom and power of modern management and development methods. Joshua is a Dad, tennis player, and international speaker. He is the author of the best-selling and award-winning book, Refactoring to Patterns, and his newest book, Joy of Agility.
















