Refactoring to Patterns. Impressions after reading the book.

Nick Alexeev

Thumbnail of the book cover
Refactoring to Patterns
by Joshua Kerievsky
2004
ISBN-13: 078-5342213355

Synopsis on the author's site
Catalog of the refactorings covered in the book

Refactoring to Patterns describes ways in which well-known design patters can emerge. Importantly, it has two prerequisites: Refactoring by Martin Fowler, and some exposure to design patterns. Refactoring to Patterns was easy for me to understand and retain. I was familiar with prerequisites.

The books Refactoring to Patterns by Joshua Kerievsky R2P[K] and Refactoring by Martin Fowler R[F] work in tandem. R2P[K] uses the basic refactorings from R[F] all the time.

This histogram illustrates that the Refactoring to Patterns book by Joshua Kerievsky focuses on composite (mid-level) refactorings.

Principles and Rationale

Both R2P[K] and R[F] introduce the principles, rationale, code smells in the beginning of the book.

Basic Refactorings

In a way, a lot of basic refactorings are obvious. Many developers were doing basic low-level refactorings even before reading about them in R[F]. But if they are obvious, then why do they occupy the valuable space in a book? The book names and catalogs them, so they can be used as incremental steps in more complex refactorings.

Composite Refactorings

Mid-level refactorings are frequent enough and non-obvious enough, so they deserve additional attention. Classic design patterns can emerge through these mid-level refactorings.

It is these mid-level refactorings that the Refactoring to Patterns book focuses on.

Big Refactorings

Big refactorings are major undertakings, and they take place over longer periods of time, so they occur less frequently compared to mid-level refactorings. They also depend more on the specifics of an application, so they are more varied. Perhaps, they don't lend themselves to cataloging as easily.

(There's a book on large refactorings by Lippert and Roock. I haven't read it, yet.)

© Copyright 2015, Nick Alexeev