Why should i use Drools? [closed]
Asked Answered
T

3

38

I am no Drools expert. I have some familiarity with it though, by experimenting with it. I am unable to appreciate, why would i need it.

My Typical Applications are Business Web Applications. Yes they do have some amount of Rules. But those are implemented using Database Tables, SQL Queries, and a nice UI in for the Business-Users to modify the Rules. Rules are not arbitrary, they are carefully thought-thru before being put in Production.

My Business Users would never ever use a (Drools)Scripting Language to modify Anything. Let Alone Modify Rules. They are perfectly happy using UI Screens to modify Rules. Plus they can make a zillion syntax mistakes in a Drools files, if i let them anywhere near it.

Again
- Why should i use Drools in this scenario?
- There are Drools fanatics i have met who insist i should change all my code to make use of Drools.

So, is Drools useful? I am not sure.

Toulon answered 3/10, 2012 at 9:30 Comment(1)
Realize this is a really old question, but I just want to point out that Drools does have some UIs to modify the rules in a "nice" way without having to worry about script syntax.Practice
P
21

Fanatics of all stripes should be questioned, no matter what topic they rave about.

Data-driven decision tables are a perfectly good way to implement complex behavior. On the day it doesn't scale or perform to your requirements, perhaps you'll want to consider something else.

I wouldn't want to make a technology swap in working production code unless I had a compelling reason. It would take a lot more than fan boy lobbying.

If you're really interested, do a PoC and get some real data. If not, learn how to politely smile and ignore them.

I've answered about this before:

Rules Engine - pros and cons

UPDATE: If it's your boss, and you can't dismiss, then make it interface based and try a Drools implementation in a PoC. If you're using Spring, inject one and then the other, measuring performance under a meaningful production rated load. Get some real data - maybe you'll both learn something.

Prepossess answered 3/10, 2012 at 9:34 Comment(3)
How to smile at your boss? :)Toulon
Duffymo I am interested to get started on Drools, would you kindly point me to some tutorial please.Why
Wouldn't the Drools project page be the first place you should look for tutorials? jboss.org/droolsPrepossess
M
8

Advantages of rule engines are;

  • Declarative Programming: Rules make it easy to express solutions to difficult problems and get the solutions verified as well. Unlike codes, Rules are written in less complex language; Business Analysts can easily read and verify a set of rules.
  • Logic and Data Separation: The data resides in the Domain Objects and the business logic resides in the Rules. Depending upon the kind of project, this kind of separation can be very advantageous.
  • Speed and Scalability: The Rete OO algorithm on which Drools is written is already a proven algorithm. With the help of Drools, your application becomes very scalable. If there are frequent change requests, one can add new rules without having to modify the existing rules.
  • Centralization of Knowledge: By using Rules, you create a repository of knowledge (a knowledge base) which is executable. It is a single point of truth for business policy. Ideally, Rules are so readable that they can also serve as documentation. Tool Integration: Tools such as Eclipse provide ways to edit and manage rules and get immediate feedback, validation, and content assistance. Auditing and debugging tools are also available.
  • Explanation Facility: Rule systems effectively provide an “explanation facility” by being able to log the decisions made by the rule engine along with why the decisions were made.
  • Understandable Rules: By creating object models and, optionally, Domain Specific Languages that model your problem domain you can set yourself up to write rules that are very close to natural language. They lend themselves to logic that is understandable to, possibly nontechnical, domain experts as they are expressed in their language, with all the program plumbing, the technical know-how being hidden away in the usual code.
Martinez answered 13/2, 2019 at 22:56 Comment(0)
M
5
  • Drools is open source.
  • It provides forward and backward chaining of rules execution
  • It provides template base rule definitions
  • It is implemented using JSR-94
  • It has decision table facility
  • Its rules are human readable
  • It is integrated with Spring
Maricruzmaridel answered 24/5, 2014 at 23:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.