Re:The Second Edition of “Refactoring”
by myth_buster on Saturday December 01, 2018 @08:53PM
(#18580286)
Null Object Pattern https://en.wikipedia.org/wiki/Null_object_pattern
[ Parent
| on HN ]
Thinking more about this, null object are meant to be neutral with respect to some behaviour, but that behaviour isn't really specified alongside the object. It seems like it's a weaker reinvention of the idea of an "identity element" from e.g., the `Monoid` typeclass. I say "weaker" because `Monoid` specifies the neutral element (`mempty`) alongside the behaviour (`mappend`), whereas the null object pattern does not.