List Info

Thread: Re: need advice re null handling




Re: need advice re null handling
user name
2007-03-15 01:06:09
I agree with SQL. If you also want to catch null you could do

Foo(field > 3 | == null)

cheers
Steve

On 3/15/07, Michael Neale < michael.nealegmail.com"> michael.nealegmail.com> wrote:
http://jira.jboss.com/jira/browse/JBRULES-627

OK, this much is clear:

Foo(field == null) can be true if field is null.

but, what about Foo(field > 3), and field is null? should that be false? what about Foo(field != 3) - should that be true?

in SQL, null will always result in a false condition, unless you explicitly use null.

Thoughts?

Michael.

_______________________________________________
rules-dev mailing list
lists.jboss.org">rules-devlists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenwobjectconsulting.com.au">stevenwobjectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
Re: need advice re null handling
user name
2007-03-15 02:46:33
yeah there is some logic to that. Certainly easier to implement ;)

I guess thinking of business rules - nulls are evil things. Even in a database, they are evil. Many an important report is incorrect cause it is built on a database that allows null values, and people don't understand the ramifications of the SQL statements used.

Nulls in your fact model: just say no !

of course... back in the real world...

Some other thoughts:

Foo(bar < 3) makes no sense if bar is null, so it should be false always in my opinion.

However, Foo(bar != 3) is not so clear for null behaviour.

On 3/15/07, Steven Williams < stevearooniegmail.com">stevearooniegmail.com > wrote:
I agree with SQL. If you also want to catch null you could do

Foo(field > 3 | == null)

cheers
Steve

On 3/15/07, Michael Neale < michael.nealegmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> michael.nealegmail.com> wrote:
http://jira.jboss.com/jira/browse/JBRULES-627

OK, this much is clear:

Foo(field == null) can be true if field is null.

but, what about Foo(field > 3), and field is null? should that be false? what about Foo(field != 3) - should that be true?

in SQL, null will always result in a false condition, unless you explicitly use null.

Thoughts?

Michael.

_______________________________________________
rules-dev mailing list
rules-devlists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">rules-devlists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
Steven Williams

Supervising Consultant

Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
stevenwobjectconsulting.com.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">stevenwobjectconsulting.com.au
www.objectconsulting.com.au

consulting | development | training | support
our experience makes the difference
_______________________________________________
rules-dev mailing list
lists.jboss.org">rules-devlists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )