Null Object (cont’d)
Consequences
- eliminates special cases for handling nil
- polymorphic not conditional code
- transparent support for optional collaborators
- null behavior is reusable
Implementation
- creating null objects for each abstraction is tedious
- null objects are often stateless and shareable
Known Uses
- Smalltalk MVC: Controller - NoController
- VisualWorks: NameScope - NullScope
Credits
- Bobby Woolf, Bruce Anderson