The former would be more efficient, just as in java code. Its comparing to identies (integer comparison) versus a method call.
(assuming the results are the same). On 3/8/06, Mitch Christensen <[EMAIL PROTECTED]> wrote: > > Hey, > > If I have a Java bean with two properties, p1 and p2 and want to have a > rule > that processes matching beans, which set of patterns is 'better' as far as > Drools is concerned? > > Assuming, > > <parameter identifier='b1'><class>MyBean</class></parameter> > <parameter identifier='b2'><class>MyBean</class></parameter> > > Then would > > <java:condition>b1.getP1() == b2.getP1()</java:condition> > <java:condition>b1.getP2() == b2.getP2()</java:condition> > > OR > > <java:condition>b1.equals(b2)</java:condition> > > (assuming I've properly implemented equals()) > > Be more appropriate? > > Are there any performance implications between the two? > > My experience with other Rete implementations is that the alpha network > performs constant tests. In Drools, I'm having a hard time visualizing > the > difference between what the alpha and beta portions of the network will be > processing. > > It seems to me that the alpha portion of the network should be responsible > for the parameter identification (is this true?), if so, does it also > apply > to conditions, and if so, to what extent? > > I have read most (if not all) of the Drools documentation and still > struggle > a bit understanding how this works. > > Any help or pointers to good documentation would be appreciated. > > Thanks. > -Mitch > > >