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.
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
Review By: Mark L. Johns 04/22/2005"Refactoring to Patterns" by Joshua Kerievsky is an exceptional book that serves well as a reference and tutorial guide on using refactoring processes combined with pattern techniques. I found "Refactoring To Patterns" to be an informative and thought provoking book. One might even get a better understanding of the book by reading Martin Fowler's "Refactoring," which Kerievsky suggests his work is based upon. Once I read Fowler's book, I found that it was easier to understand Kerievsky's examples.
The book begins with the author explaining why he wrote the book and the metamorphosis he went through as he learned more by utilizing patterns in his daily work. He then delves into refactoring and patterns, devoting a complete chapter to each. In these chapters, Kerievsky defines the concepts, backgrounds, and benefits.
After laying the groundwork and educating the reader, the author dives into "Code Smells" that can be used to reveal if your code needs to be refactored. Twelve different design smells are detailed, preparing the reader to "deodorize" any code.
Chapter 5 formulates the refactoring patterns used in the book. These formulas are very similar in format to those used by Martin Fowler in his book "Refactoring." The remaining chapters (6 through 11) compose a catalog of twenty-seven examples based upon the author's real-world coding efforts that has been enhanced by input from other programmers.
Kereivsky's examples are probably the greatest strength and weakness of the book. The examples are straight from the real world and are highly detailed. His approach is methodical and incremental. But I also had to do further research to understand the full scope of the example. At times, I found myself having to study other references to understand what was going on. This only happens a couple of times and is probably unavoidable given the universe of real-world examples versus real-world experiences.
One of the most refreshing aspects of this book is the author's attitude toward the topic. Kerievsky's attitude borders on skepticism at times about the use of patterns. Based upon his personal experience, he talks about over-engineering designs and forcing patterns onto lightweight projects where they aren't needed and shouldn't really be used. He mentions Agile programming and even works the concept of continuous testing into the book.
I consider both of these, to be huge "wins" for the Quality Assurance and Quality Control area. Methodology/Process for process sake and the lack of support for testing during development have always been issues. With this text, Kerievsky will hopefully be able to coax those that fear the methodology into trying it and making intra-process testing a part of normal practice.
"Refactoring Patterns" is a great companion book or add-on to Martin Fowlers' "Refactoring." This book is a must-have for any programmer wanting to understand and improve their knowledge on software design or redesign.
Review By: Mike Cohn 04/22/2005"Refactoring to Patterns" is an extremely well written book. (I'm certain that the book went through extensive editing and polishing.) The author is clearly the authority on his subject. He draws on a wide variety of examples from both real-projects and other literature on patterns. I appreciate that Kerievsky present both advantages and disadvantages of some refactorings. Not all refactorings or patterns are cut-and-dry, and it was nice to read about the cases when I may want to use or avoid one.
All examples are in Java but Kerievsky has taken great care to keep the examples simple. So, even if you are not a Java programmer or are only familiar with the language, you should have no problem with the code.
The book starts out with a chapter dedicated to refactoring and another to patterns. These chapters are short and the vast majority of the book is dedicated to a catalog of refactorings to patterns. Each refactoring then mostly follows the format originated in Martin Fowler's Refactoring. Each refactoring is described by a name, summary, a reason to use it, the mechanics of performing the refactoring, an example, and a discussion of variations on the general case.
I used to think of refactoring as what I would do to old or legacy code in order to try to get another year or two of life from the code. Conversely, patterns were what we discussed at the start of a project. I spent many hours with various project architects and object-oriented designers talking about the patterns we'd use to guide our code. During these discussions, the various patterns took on the aura of the ideals we would strive for. Once our code began deviating from these ideals, we were rarely able to get it back. Kerievsky shows why and how this does not need to be the case. It is possible to progressively refactor existing code toward patterns.
Joshua Kerievsky’s "Refactoring to Patterns" covers two of the most important innovations of the 1990s. Not surprisingly, when these two topics are considered together, the sum is definitely more than the parts. Refactoring to Patterns is a future classic. It is highly readable, thorough, and full of informative examples. It would be impossible to read Refactoring to Patterns and not become a better programmer for the effort.