This can be a hard one, since it requires from you to be familiar with Drools.
Consider the condition side of the following rules:
rule "object comparison one"
no-loop
when
$customer1 : Customer( )
$customer2 : Customer(this != $customer1)
then
System.out.println("Rule one - Objects are equal");
end
rule "object comparison two"
no-loop
when
$customer1 : Customer( )
$customer2 : Customer(eval(this != $customer1))
then
System.out.println("Rule two - Objects are equal");
end
Question(s):
Which of the two rules does valid comparison of the two Customer instances?
Which of the two rules is invalid? Why?
Looking forward for your answers dear readers
Resources:
Drools JBoss Rules 5.0 Developer’s Guide July 2009
Brainteaser Drools: Testing Objects:
This can be a hard one, since it requires from you to be familiar with Dr.. http://bit.ly/4wykv0