Skip to main content
3 events
when toggle format what by license comment
Aug 7, 2014 at 10:22 comment added MikeFHay @Andres Huh, good point, I guess a proper monadic Option is sort of a generalised Null Object. Although sticking with the empty Collection example, it's easier to define the many different behaviours of contains, isEmpty, size etc. in one place than to do (in Java 8) maybeCollection.map(Collection::contains(x)).orElse(false) and such all over the place. For simpler, smaller interfaces though, I suppose Option makes the Null Object pattern redundant.
Aug 6, 2014 at 23:19 comment added Andres F. In which way is the Null Object Pattern better than an Option type?
May 2, 2014 at 10:26 history answered MikeFHay CC BY-SA 3.0