3 ms·
In object-oriented modelling you often see the Null Object pattern being used to the same effect. http://en.wikipedia.org/wiki/Null_Object_pattern http://en.wi
by radicalbyte 14y ago
In object-oriented modelling you often see the Null Object pattern being used to the same effect.
http://en.wikipedia.org/wiki/Null_Object_pattern http://en.wikipedia.org/wiki/Null_Object_pattern
It needs static analysis tools such as Code Contracts (C#) or SpringContracts (Java) to make it really robust.
- happy_dino 14y agoThe null object pattern and Maybe/Option are different concepts. The most important point: A NOP for some type T exposes T's API directly, while Maybe/Option has its own API (and the type system enforces that Option[T] can't be treated as a T).