<div dir="ltr">What is really wrong with returning &#39;null&#39; ?<div style>I&#39;m used to this situation when using Hibernate for example, when the user don&#39;t exist then it just return null and it&#39;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">&lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;</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 &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:<br>

&gt; Hi All,<br>
&gt; 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>
&gt; method to retrieve an user (based on its id). If the user don&#39;t exist it<br>
&gt; returns null.<br>
&gt;<br>
&gt; There were some suggestions to change that into :<br>
&gt; - throwing a runtime exception (seems a bit brutal)<br>
<br>
</div>+1 on exception<br>
<br>
-M<br>
<div class="im HOEnZb"><br>
<br>
&gt; - or returning an empty user (can be confusing)<br>
&gt;<br>
&gt; What is your opinion about this ?<br>
&gt;<br>
&gt; Seb<br>
&gt;<br>
&gt; ps: the method <a href="https://gist.github.com/4510879" target="_blank">https://gist.github.com/4510879</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
</div><div class="im HOEnZb">&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<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>