Embed presentation
Downloaded 30 times









This document describes the Null Object pattern. The Null Object pattern provides an object that acts as a surrogate for another object that shares the same interface but does nothing. This encapsulates how to do nothing and hides those details from collaborators. The pattern involves an abstract class that defines the interface, a real object subclass that provides behavior, and a null object subclass that implements the interface but does nothing. Using a null object avoids checks for null values and simplifies client code.








