diff --git a/README.md b/README.md index d484808b7..9ebc423ac 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ * [Model-View-Presenter](#model-view-presenter) * [Double Checked Locking](#double-checked-locking) * [Servant](#servant) +* [Null Object](#null-object) ## Abstract Factory [↑](#list-of-design-patterns) **Intent:** Provide an interface for creating families of related or dependent objects without specifying their concrete classes. @@ -382,6 +383,14 @@ **Applicability:** Use the Servant pattern when * When we want some objects to perform a common action and don't want to define this action as a method in every class. +## Null Object [↑](#list-of-design-patterns) +**Intent:** Null Object is used instead of null values to simplify algorithm and avoid explicit null checking. + +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/null-object/etc/test.png "Null Object") + +**Applicability:** Use the Null Object pattern when +* You want to avoid explicit null checks and keep algorithm elegant and easy to read. + # Frequently asked questions