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 low-level 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.