[aerogear-dev] Android library: Are nulls icky

Bruno Oliveira bruno at abstractj.org
Thu Oct 25 06:15:15 EDT 2012


+1 on follow the same approach 


-- 
"The measure of a man is what he does with power" - Plato
-
@abstractj
-
Volenti Nihil Difficile



On Thursday, October 25, 2012 at 3:52 AM, Matthias Wessendorf wrote:

> returning a "null object", which does nothing would be an interesting approach..
> 
> That said, I think on iOS (for now) i stay with the current approach returning 'nil' - if a store,pipe,(auth)module could not be found. I guess JS does the same. 
> 
> 
> 
> On Wed, Oct 24, 2012 at 9:03 PM, <supittma at redhat.com (mailto:supittma at redhat.com)> wrote:
> > 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 (mailto: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 (mailto:aerogear-dev at lists.jboss.org)
> > > https://lists.jboss.org/mailman/listinfo/aerogear-dev
> > 
> > _______________________________________________
> > aerogear-dev mailing list
> > aerogear-dev at lists.jboss.org (mailto:aerogear-dev at lists.jboss.org)
> > https://lists.jboss.org/mailman/listinfo/aerogear-dev
> 
> 
> 
> -- 
> Matthias Wessendorf 
> 
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org (mailto:aerogear-dev at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20121025/4cb47111/attachment.html 


More information about the aerogear-dev mailing list