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

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.

## 改善的可维护性 (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.

## 灵活性： (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.

## 合理的表现 (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.

## 将需求转化为规则 (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.

## 能够将企业管理应用于我们的规则 (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.

02-14
10-27 4480
09-22 615
03-19 3146
07-06 316
06-25 2万+
02-07 153
12-22 384
12-08 2万+
04-09 2300
10-11 166
08-26 4836
12-10
01-30 1580
04-07 7019
01-20 5万+
05-27 1437