REVIEW - Refactoring to Patterns


Refactoring to Patterns


Joshua Kerievsky




Addison-Wesley Professional (2005)




Alan Lenton


April 2014



Reviewed: May 2013

For some reason this book escaped my notice until recently, which is a pity, because it’s a very useful book indeed. Quite a lot of programmers, even those using agile methods, seem to think that patterns are merely something that you spot at the design stage. This is not the case, though it’s useful if you do spot a pattern early on. Programs evolve, and as they do, patterns become more obvious, and indeed may not have been appropriate at earlier stages of the evolution.

The book, as its title implies, deals with evolving programs, and does it very well. The bulk of the book takes a relatively small number of patterns and, using real world examples, gives a step by step analysis, with Java code, of how to refactor into the pattern. As long as readers do treat these as examples, rather than something set in stone, they will learn a lot about the arts of identifying patterns and the nitty gritty of refactoring.

I also liked the pragmatism of the author. Unlike some pattern freaks, he freely admits that there are times when using a specific pattern is overkill, especially where the problem is simple. Most people, myself included, when the idea of patterns are first grasped, tend to see patterns in everything and immediately implement them. This is frequently inappropriate, and rather than making the program structure clearer, muddies the waters. There are a number of warnings in the book against this approach.

I was very impressed by this book. In fact it is one of a small number of books that has made it to my work desk, where it fits, both intellectually and literally, in between the Gang of Four’s Design Patterns, and Martin Fowler’s Refactoring!

Highly recommended.

Book cover image courtesy of Open Library.