Skip to content

Files

Latest commit

 

History

History

NullObjectPattern

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Null Object Pattern

Replacing conditionals (if obj == null {...} else {...}) with polymorpism.
Replaces a null with a null-object to avoid if statements.
Also can represent a null-behaviour (for instance when collecting a power-up in a game,
that doesn't allow the player to move for x number of seconds).

UML diagram:

Alt text