开发者

Reasoning behind using a rules engines

This is more of a generic question. But I am trying to understand a concept of using a tool and why one would need this tool. I keep going round and round.

q)Why do we need rule engines?

I have been reading up on Drools and ILOG rule engines and am still not clear on the concept of what benefit an organization can have using these tools.

q)Is it just to give the business users a way to fire queries ( which are being referred to as rules ) to the database ( repository ) ?

Doesn't this extra piece of s/w just result more money spent on licences and support in comparison to the benefit achieved?

We 开发者_Go百科anyways have a all the applications doing the same thing.

Example: If sales < $ 5000000 then order shipment = No

Above is example of a business logic. This is easily implemented in the program. So what is the benefit of going via a rules engine?

Any input would be great! Thank you.


Did you have a look at this doc : Why should I use a rule engine ?

It's pretty clear when to use and not use a rule engine.

Have a closer look at these 2 paragrpahs :

1.2.5. Strong and Loose Coupling

No doubt you have heard terms like "tight coupling" and "loose coupling" in systems design. Generally people assert that "loose" or "weak" coupling is preferable in design terms, due to the added flexibility it affords. Similarly, you can have "strongly coupled" and "weakly coupled" rules. Strongly coupled in this sense means that one rule "firing" will clearly result in another rule firing, and so on; in other words, there is a clear (probably obvious) chain of logic. If your rules are all strongly coupled, the chances are that the will turn out to be inflexible, and, more significantly, that a rule engine is an overkill. A clear chain can be hard coded, or implemented using a Decision Tree. This is not to say that strong coupling is inherently bad, but it is a point to keep in mind when considering a rule engine and the way you capture the rules. "Loosely" coupled rules should result in a system that allows rules to be changed, removed and added without requiring changes to other, unrelated rules.

and

It seems to me that in the excitement of working with rules engines, that people forget that a rules engine is only one piece of a complex application or solution. Rules engines are not really intended to handle workflow or process executions nor are workflow engines or process management tools designed to do rules. Use the right tool for the job. Sure, a pair of pliers can be used as a hammering tool in a pinch, but that's not what it's designed for. --Dave Hamu

Hope it helps


There are a lot of advantages of using a business rule engine or a business rule management suite. When you start to decoupling the business logic from your application using a declarative approach you end up having your business knowledge expressed in those rules. This fact is extremely valuable for a company that can have all their knowledge in a centralized repository and all their applications can re-use.

The declarative power is also a key concept in my perspective. The idea of letting the engine to pick the rules that are needed for a specific situation is great. Rules engines are optimized for that purpose and makes a really good job when you have tons of rules that must be evaluated.

Hope it helps :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜