<div dir="ltr">What is really wrong with returning 'null' ?<div style>I'm used to this situation when using Hibernate for example, when the user don't exist then it just return null and it's up to the developer (as Lucas said) to handle this situation ...</div>
<div style>Seb</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 11, 2013 at 5:02 PM, Matthias Wessendorf <span dir="ltr"><<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Jan 11, 2013 at 4:01 PM, Sebastien Blanc <<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>> wrote:<br>
> Hi All,<br>
> In the scope of <a href="https://issues.jboss.org/browse/AEROGEAR-803" target="_blank">https://issues.jboss.org/browse/AEROGEAR-803</a> , we have a<br>
> method to retrieve an user (based on its id). If the user don't exist it<br>
> returns null.<br>
><br>
> There were some suggestions to change that into :<br>
> - throwing a runtime exception (seems a bit brutal)<br>
<br>
</div>+1 on exception<br>
<br>
-M<br>
<div class="im HOEnZb"><br>
<br>
> - or returning an empty user (can be confusing)<br>
><br>
> What is your opinion about this ?<br>
><br>
> Seb<br>
><br>
> ps: the method <a href="https://gist.github.com/4510879" target="_blank">https://gist.github.com/4510879</a><br>
><br>
><br>
><br>
</div><div class="im HOEnZb">> _______________________________________________<br>
> aerogear-dev mailing list<br>
> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
><br>
<br>
<br>
<br>
</div><span class="HOEnZb"><font color="#888888">--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br></div>