Thats a good point tom. In fact, null can be kind of like a special "state" - certainly with databases it is. <br><br>Keep the thoughts coming please.<br><br><div><span class="gmail_quote">On 3/16/07, <b class="gmail_sendername">
Tom Gonzalez</b> <<a href="mailto:tomgon@nortel.com">tomgon@nortel.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
<div><font color="#0000ff" face="Arial" size="2"><span>We
handle it as it can't be anything else but null cause null is returned when an
access fails or some error occurs. This keeps it from falling into a valid
evaluation and possibly a subtle bug going uncaught.</span></font></div>
<div><font color="#0000ff" face="Arial" size="2"><span></span></font> </div>
<div><font color="#0000ff" face="Arial" size="2"><span>Tom
G</span></font></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><span class="q"><b>From:</b> <a href="mailto:rules-dev-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-dev-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-dev-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-dev-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Mark
Proctor<br></span><b>Sent:</b> Thursday, March 15, 2007 12:42 PM</font><div><span class="e" id="q_111568dda547e9ff_3"><font face="Tahoma" size="2"><br><b>To:</b> Rules
Dev List<br><b>Subject:</b> Re: [rules-dev] need advice re null
handling<br></font></span></div><br></div><div><span class="e" id="q_111568dda547e9ff_5">
<div></div>Its not about giving it up, its how we handle when those fields are
null, do we treat it like a primitive and assume its 0, or do we say it can't be
equal to anything else but null.<br><br>In the following example neither y or z
is defined, thus y is null and z is 0;<br><br>int x = 0;<br>Integer y;<br>in
z;<br>x == y // is false;<br>x == z // is true<br>y == null // is
true<br><br>Mark<br><br>Tom Gonzalez wrote:
<blockquote type="cite">
<div><span><font color="#0000ff" face="Arial" size="2">The
flexibility provided by an Object is very valuable. We use Integer and String
objects all over the place today in our facts with drools. I would
hate to give it up.</font></span></div>
<div><span></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">Tom
G</font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:rules-dev-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-dev-bounces@lists.jboss.org</a>
[<a href="mailto:rules-dev-bounces@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mailto:rules-dev-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Mark Proctor<br><b>Sent:</b> Thursday, March 15, 2007 6:29
AM<br><b>To:</b> Rules Dev List<br><b>Subject:</b> Re: [rules-dev] need advice
re null handling<br></font><br></div>if bar is an integer it will be 0, if its
an Integer it will be null. The Q is do we make Integer work like the
primitive, or do we make it work like an Object.<br><br>Mark<br>Michael Neale
wrote:
<blockquote type="cite"><a href="http://jira.jboss.com/jira/browse/JBRULES-627" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://jira.jboss.com/jira/browse/JBRULES-627</a><br><br>OK,
this much is clear: <br><br>Foo(field == null) can be true if field is
null.<br><br>but, what about Foo(field > 3), and field is null? should
that be false? what about Foo(field != 3) - should that be true? <br><br>in
SQL, null will always result in a false condition, unless you explicitly use
null.<br><br>Thoughts? <br><br>Michael.<br><pre><hr size="4" width="90%">
_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre></blockquote><br><pre><hr size="4" width="90%">
_______________________________________________<br>rules-dev mailing list<br><a href="mailto:rules-dev@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre></blockquote><br></span></div></div>
<br>_______________________________________________<br>rules-dev mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-dev</a><br><br></blockquote></div><br>