Skip to content

Latest commit

 

History

History

Null Object

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Null Object

Null Object pattern can be used to replaces check of NULL object instance. Instead of putting if check for a null value, Null Object reflects a do nothing relationship.

base

For example, we will make a User object where the user can be null. If the user is null and they want to buy, then it will not be executed.

example

Source