Nice post, Gerret. Cean logic, nicely presented. Separation of concerns vs tangled web of dependencies..... woooohooo!<br><br><div class="gmail_quote">On Thu, Feb 18, 2010 at 3:05 AM, Gerret Hansper <span dir="ltr">&lt;<a href="mailto:gerret.public@gmx.de">gerret.public@gmx.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Mike,<br>
<br>
I have been working with Drools for only a few months now and am still rather<br>
new to it, but we&#39;ve have made the same experience, switching from rules only to<br>
rules with flow, and I&#39;m certain it&#39;s the right way to go.<br>
<br>
The performance implications you mention depend mainly on the way the rules are<br>
set up, I guess.<br>
That is, if you have expensive RHS expressions like eval() you might indeed<br>
profit from keeping your glucose-level condition at the beginning of the rules<br>
which would prevent those expressions from being reevaluted, as far as I<br>
understand.<br>
If you don&#39;t I can hardly imagine that activating the rules makes up a<br>
noticeable fraction of the overall time of your process.<br>
<br>
We here have a scenario where some rules may be activated only if the user<br>
starting the session has got corresponding privileges.<br>
Since determining the priviliges is not always trivial we definitely wanted to<br>
have that logic in one place. The first thing to do was to use inference<br>
(<a href="http://docs.codehaus.org/display/LOGICABYSS/Policy+Encapsulation" target="_blank">http://docs.codehaus.org/display/LOGICABYSS/Policy+Encapsulation</a>) but still<br>
already with a few dozen rules and including other constraints the rule RHsides<br>
became rather cluttered. Moreover it was getting increasingly complex to<br>
control the order in which the rules fired, maintanance being another issue.<br>
<br>
Using a rule flow we have achieved really good separation of concerns: A rule&#39;s<br>
RHS mostly contains exactly those conditions that apply to its intent, none of<br>
the cross-concerns or technicalities. (Hey, what about an AspectDrools<br>
implementation? ;-) )<br>
I am confident that OO lessons apply here, too: If you have a clean design and<br>
performance problems start to show up you are much more likely to solve them<br>
than if you have a tangled web of dependencies.<br>
<br>
Greetings,<br>
<font color="#888888">        Gerret<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>