[aerogear-dev] Android library: Are nulls icky

supittma at redhat.com supittma at redhat.com
Wed Oct 24 14:12:29 EDT 2012


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


More information about the aerogear-dev mailing list