Skip to content

An object that does nothing

Code is littered with if (logger != null) logger.log(...). The null object pattern supplies a logger whose methods do nothing.

What does this buy?