Book Review: Refactoring to Patterns

Refactoring to Patterns provides some of the glue that Design Patterns (GoF) and Patterns of Enterprise Application Architecture (PoEAA is missing. The concept of the book is very simple: to provide examples of how to use design patterns to refactor code. A side product of this is the reader should really have an understanding of the two books previously mentioned before reading this book. If GoF and PoEAA is the bible, then Refactoring to Patterns is the Sunday school teacher. I definitely recommend it to every developer.

What I love most about this book isn’t the content, but how it attacks problems. Every developer has created code that isn’t beautiful. Code that quickly becomes unmanagable. This book bridges the divide between that code and a beautiful, design patterns based solution. When I first skimmed through some of the refactorings, I thought really? Compose Method made it into this book? But then I started thinking that it is probably the simplest, yet most under utilized design pattern around.

Much like GoF or PoEAA, this book should not be read once, but regularly. I would encourage readers to try and take one or two things away from the book, not everything. Memorizing the steps or refactorings isn’t as important as understand where and when they should be used. Personally, Compose method, Move Accumulation to Collecting Parameter, and Replace Constructors with Creation Methods are the refactorings I took away from the book.

Although I wrote this whole review, the afterword of the book contains the best summary of what this book means to developers.

The true value of this book lies not in the actual steps to achieve a particular pattern but in understanding the thought processes that lead to those steps