We present this excerpt, "Introduce Null Object," from Refactoring to Patterns, by Joshua Kerievsky, copyright 2004. All rights reserved. This excerpt is posted with permission from Addison-Wesley.
This refactoring is one of several presented in a chapter on protection. Kerievsky points out the differences between the techniques and applicability of his version of the refactoring and the one that appears in Martin Fowler's book Refactoring. He has also kindly agreed to host this month's Bookclub discussion on this book.
We are presenting this excerpt as a 160K PDF download: Introduce Null Object.