流程引擎规则引擎_规则引擎的优势

规则引擎提供更好的可理解和维护性,应对复杂的业务变化。它具有灵活性,能轻松处理需求或数据模型变动,且性能表现良好。规则引擎通过形式化的规则,简化了问题解决,使得代码更易于阅读和重用。此外,它还允许企业级管理和统一规则与流程,便于部署和更新。
摘要由CSDN通过智能技术生成

流程引擎规则引擎

Following are some of the major advantages of a Rule Engine:

以下是规则引擎的一些主要优点:

更容易理解 (Easier to understand)

Rules are easier to understand for a business analyst or a new developer than a program written in Java or other imperative-style language.

对于业务分析师或新开发人员而言,规则比用Java或其他命令式语言编写的程序更容易理解。

改善的可维护性 (Improved maintainability)

Since rules are easier to understand, a developer can spend more time solving the actual problem.

由于规则更容易理解,因此开发人员可以花费更多时间来解决实际问题。

应对不断变化的复杂性 (Dealing with evolving complexity)

It is much easier to add new, modify, or remove existing rules than to change, for example, a Java program. The impact this has on other rules is minimal in comparison with an imperative-style implementation.

添加新的,修改或删除现有规则要比更改(例如Java程序)容易得多。 与命令式实现相比,这对其他规则的影响是最小的。

灵活性: (Flexibility:)

It deals better with changes to the requirements or changes to the data model. Changing or rewriting an application is never an easy task. However, thanks to the formalism that rules bring, it is much easier to change rules than to change a Java program.

它可以更好地处理对需求的更改或对数据模型的更改。 更改重写应用程序绝非易事。 但是,由于规则带来的形式主义,更改规则比更改Java程序容易得多。

合理的表现 (Reasonable performance)

Thanks to the Rete algorithm that is behind Drools; in theory, the performance of the system doesn't depend on the number of rules. With every release of Drools, the performance of the engine is getting better by adding various optimizations such as Rete node sharing, node indexing, parallel execution, and so on. All this benefits new as well as old rules.

多亏了Drools背后的Rete算法 ; 从理论上讲,系统的性能不取决于规则的数量。 在Drools的每个发行版中,通过添加各种优化(例如Rete节点共享节点索引并行执行等) ,引擎的性能都会得到改善。 所有这些都有益于新旧规则。

将需求转化为规则 (Translating requirements into rules)

The representation of business rules is consistent. For example, let's take some business rule and implement it in Java. Developers, depending on their experience, tend to use different ways to solve a problem. We'll find out that the possible solutions will vary greatly. Whereas with rules, this diversification becomes less apparent. It is simply because we are expressing "what" instead of "how". As a result the code is much easier to read even by new developers.

业务规则的表示是一致的。 例如,让我们采用一些业务规则,并在Java实现它。 开发人员根据他们的经验,倾向于使用不同的方法来解决问题。 我们将发现可能的解决方案将有很大的不同。 鉴于规则,这种多样化变得不那么明显。 仅仅是因为我们表达的是“什么”而不是“如何” 。 结果,即使是新开发人员,代码也更容易阅读。

能够将企业管理应用于我们的规则 (Ability to apply enterprise management to our rules)

This builds on the previous advantage of consistent representation. If we have consistent representation, it is much easier to introduce new features that apply across all our rules (for example, auditing, logging, reporting, or performance optimizations)

这建立在一致表示的先前优势之上。 如果我们具有一致的表示形式,那么引入适用于我们所有规则的新功能(例如审计日志记录报告性能优化 )会容易得多。

可重用性: (Reusability:)

The rules are kept in one place (separation of business logic from the rest of the system), which means easier reusability. For example, imagine you've written some validation rules for your application and later on there is a need to do some batch imports of data, so you could simply reuse the validation rules in your batch import application.

规则保存在一个地方(将业务逻辑与系统的其余部分分开),这意味着更易于重用。 例如,假设您已经为应用程序编写了一些验证规则,然后需要进行一些批处理数据导入,那么您可以简单地在批处理导入应用程序中重用验证规则。

紧密建模应用程序 (Modeling the application closely)

Rules model the application invariants more closely. The imperative-style solutions tend to impose arbitrary and often unnecessary ordering on operations, depending on the algorithm chosen. This then hides the original invariants of the application.

规则更紧密地模拟了应用程序不变式。 命令式解决方案倾向于根据所选择的算法对操作施加任意且通常不必要的排序。 然后,这将隐藏应用程序的原始不变式。

统一 (Unifying)

The Drools platform brings unification of rules and processes. It is easy to call rules from a process or vice versa.

Drools平台带来了规则和流程的统一。 从流程中调用规则很容易,反之亦然。

重新部署 (Redeploying)

It is possible to change/redeploy rules and processes without even stopping the whole application.

甚至可以在不停止整个应用程序的情况下更改/重新部署规则和流程。

翻译自: https://www.studytonight.com/drools/advantage-rule-engine

流程引擎规则引擎

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值