The Null Object Pattern – Polymorphism in Domain Models
In a traditional approach, the consumer of a model must check for nulls and handle the condition gracefully when valid data cannot be returned, but this generates an explosion of conditionals throughout your code. Fortunately this tangled situation can be sorted out simply by creating a polymorphic implementation of the domain object using a design pattern called Null Object. Learn more about the benefits of Null Object with this article.







