When is a Business Rules Engine used

前端 未结 3 545
盖世英雄少女心
盖世英雄少女心 2021-02-02 17:22

When is a Business Rules Engine used?

What is the difference between Business Rules Engines and scripting/configuration/customization

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-02 17:57

    Business rules engines are typically used to provide customizable "IF some-condidtion THEN do-something" sorts of logic to applications. These types of business rules can trigger certain workflows to execute or bubble up event knowledge to higher level rules, causing them to be evaluated.

    Using a rule engine also allows for easier separation of concerns by removing the business logic from your code. Rules engines today typically also offer a front-end where users can add new rules without having to modify scripts inside the application.

    Rules engines implement algorithms such as Rete (speaking from Drools experience) that make the task of evaluating the rules quicker. The rule engine also provides forward chaining, backward chaining, hybrid chaining, etc. of rules. However, these could be implemented in a scripting language as well. You can achieve some of the same sorts of things with both approaches, but I believe that it depends on the complexity and number of rules as to which avenue you should choose.

    Take a look at this link from the Jess project: http://www.jessrules.com/guidelines.shtml

    It provides a step-by-step walk through of questions to ask yourself in order to determine if a rules engine meets your needs, or is overkill.

提交回复
热议问题