[aerogear-dev] Android library: Are nulls icky

supittma at redhat.com supittma at redhat.com
Wed Oct 24 15:03:02 EDT 2012


I've added a gist with some pseudo code to describe what I am talking bout.

https://gist.github.com/1efc515a68e3585817f4

On 10/24/2012 02:12 PM, supittma at redhat.com wrote:
> So I try to avoid nulls wherever possible.  In the case of the
> Authenticator (and Pipeline) API's we have methods get(String name).
>
> The obvious thing to do would be to return a null object if the name
> isn't a known name.
>
> Would it be better/preferable to return some kind of default
> AuthenticationModule (or Pipe) which does nothing instead?
>
> Alternatively we could supply a peek(name) method which tests for the
> name and throw an exception if you call get with a bad name.
>
> Just some idle thoughts.
>
> Summers
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev



More information about the aerogear-dev mailing list