[rules-users] Drool rules vs java code, effiency

Esteban Aliverti esteban.aliverti at gmail.com
Tue Oct 30 06:48:18 EDT 2012


Thanks Wolfgang for adding completeness to my response.

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Tue, Oct 30, 2012 at 11:07 AM, Wolfgang Laun <wolfgang.laun at gmail.com>wrote:

> See below.
>
> On 30/10/2012, Esteban Aliverti <esteban.aliverti at gmail.com> wrote:
> > For simple validation rules the main benefit of using drools is the
> > decoupling of your business logic from your application. Another benefit
> is
> > the power of DRL language. For example, implementing the 'exists',
> > 'collect', 'accumulate', 'from' etc. behavior in plain java is not a
> > trivial task.
>
> This enumeration omits the most important feature available in a rule's
> condition: the dynamic creations of all Cartesian products of facts
> matching the constraints. Example:
>
>    $p: Person( age >= 60 )
>    Car( owner == $p )
>
> This finds all cars owned by persons over 60, which relieves you from the
> task
> of writing loops to determine all matching combinations, which can become
> quite
> cumbersome with increasing complexity.
>
> > In Drools you already have all that power and you can create
> > really complex rules with just a few lines of DRL.
> > For more complex scenarios, you can use Drools for:
> >
> >    - make inference (impossible to do in java without implementing some
> >    kind of inference engine).
> >    - use temporal patterns in your rules.
> >    - Use TMS
> >    - more...
>
> There is the option of creating a domain specific language on top
> of DRL, which is one way of making your business logic intellegible
> to non-programmers, so that they can at least understand what's
> going on.
>
> -W
>
>
> >
> > Best Regards,
> >
> > XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> >
> > Esteban Aliverti
> > - Blog @ http://ilesteban.wordpress.com
> >
> >
> > On Tue, Oct 30, 2012 at 9:43 AM, cheikh dhib <dhib.cheikh at gmail.com>
> wrote:
> >
> >> Hello,
> >> This is what i think (has to be confirmed from specialist)
> >>
> >> Every thing you do in Drools you can do it as well in Java. But if you
> >> have a modification on your java code, you have to modify, then compile
> >> and deploy. contrary to the Drl rules which are interpreted, so after
> >> modification you don't need to do any thing just save your modification.
> >> So in the case of drools you have some flexibility which means that the
> >> rules can be managed directly by the decider and not the developer.
> >>
> >> regards,
> >> Cheikh
> >>
> >>
> >> Le 29/10/2012 23:57, kina06 a écrit :
> >> > Please don't ignore this question as routine, did google and read
> >> posting,
> >> > didn't get satisfying answer, hope you guys can help.
> >> >
> >> > I have seen some drool rules in our company, I know drools provide
> >> > declarative rules, easy to modify etc etc, but I see it does need some
> >> > programming knowledge, so why not put all your rule logic into Java
> >> > code,
> >> > what is drools doing different can't be implemented in Java a separate
> >> > package (like your logic package). Except losing flexibility of modify
> >> > code/logic in text file I don't  see much benefit.
> >> >
> >> > Please help me understand, whats the major benefit of drools rules
> that
> >> > can't be done in Java with same set of concise code.
> >> >
> >> >
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://drools.46999.n3.nabble.com/Drool-rules-vs-java-code-effiency-tp4020549.html
> >> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> >> > _______________________________________________
> >> > rules-users mailing list
> >> > rules-users at lists.jboss.org
> >> > https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20121030/61f6c6ce/attachment-0001.html 


More information about the rules-users mailing list