何时使用业务规则引擎

发布于 2024-07-17 02:17:40 字数 51 浏览 10 评论 0原文

何时使用业务规则引擎?

业务规则引擎和脚本/配置/定制之间有什么区别

When is a Business Rules Engine used?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冰火雁神 2024-07-24 02:17:40

当您尝试在代码中实现决策时,应使用业务规则引擎或业务规则管理系统。 但不仅仅是任何决定。 一项决策:

  • 涉及大量规则
  • 具有经常更改的规则
  • 具有复杂或以复杂方式交互的规则(否则考虑大量嵌套的 IF)
  • 具有只有具有领域知识的人才能理解/验证的规则
  • 是业务人员真正需要的规则希望能够在没有您帮助的情况下进行改变
  • 涉及使用预测分析/评分作为决策的一部分

这些是使用业务规则管理系统带来回报的决策类型。 不要从规则开始,而是从决策开始。

业务规则是冗长的(因此业务人员发现它们更容易阅读)、声明性而非过程性和原子性(因此它们可以像数据库中的数据一样被存储、管理和重用)。

有关为什么使用业务规则的更多信息,请参阅本文 我相信商业规则

A business rules engine, or a business rules management system, should be used when you are trying to implement a decision in your code. But not just any decision. A decision that:

  • Involves lots of rules
  • Has rules that change often
  • Has rules that are complex or interact in complex ways (think lots of nested IFs otherwise)
  • Has rules that only someone with domain knowledge can understand/verify
  • Is one that the business people REALLY want to be able to change without your help
  • Involves using predictive analytics / scores as part of the decision making

These are the kinds of decisions that pay off the use of a business rules management system. Don't start with the rules, start with the DECISIONS.

Business rules are verbose (so business people find them easier to read), declarative not procedural and atomic (so they can be stored, managed and reused like data in a database).

More on why to use business rules here in this piece on why I believe in business rules.

毁梦 2024-07-24 02:17:40

业务规则引擎通常用于向应用程序提供可定制的“IF some-condition-THEN do-something”类型的逻辑。 这些类型的业务规则可以触发某些工作流程来执行或将事件知识冒泡到更高级别的规则,从而对它们进行评估。

使用规则引擎还可以通过从代码中删除业务逻辑来更轻松地分离关注点。 如今的规则引擎通常还提供一个前端,用户可以在其中添加新规则,而无需修改应用程序内的脚本。

规则引擎实现了 Rete(根据 Drools 的经验)等算法,可以更快地完成评估规则的任务。 规则引擎还提供规则的前向链接、后向链接、混合链接等。 然而,这些也可以用脚本语言来实现。 您可以使用这两种方法实现一些相同的事情,但我相信这取决于您应该选择哪种途径的规则的复杂性和数量。

看一下 Jess 项目中的链接:http://www.jessrules.com/guidelines.shtml< /a>

它提供了一个逐步演练的问题来询问自己,以确定规则引擎是否满足您的需求,或者是否过度。

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.

素衣风尘叹 2024-07-24 02:17:40

规则引擎可以进行前向和后向链接以及推理。 查看 Fair Isaac Blaze、Drools 或 iLog 的实现。

Rules engines can do forward and backward chaining as well as inferencing. Check out Fair Isaac Blaze, Drools or iLog for implementations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文