Rules Engine - pros and cons

前端 未结 12 1224
北荒
北荒 2020-12-02 04:25

I\'m auditing a project that uses what is called a Rules Engine. In short, it\'s a way to externalize business logic from application code.

This concept is entirely

12条回答
  •  悲&欢浪女
    2020-12-02 04:59

    Lots of good answers already but wanted to add a couple of things:

    1. in automating a decision of any complexity the critical thing rapidly becomes your ability to manage rather than execute the logic involved. A rules engine will not help with this - you need to think about the rule management capabilities that a business rules management system has. Most commercial and open source rules engines have evolved into rule management systems with repositories, reporting on rule usage, versioning etc. A repository of rules, structured into coherent rule sets that can be orchestrated to make business decisions is a lot easier to manage than either thousands of lines of code or a rule soup.
    2. There are many ways to use a declarative, rules-based approach. Using rules to manage a UI or as part of defining a process can be very effective. The most valuable use of a rules approach, however, is to automate business decisions and to deliver this as loosely coupled decision services that take input, execute rules and return an answer - a decision. Thing of these as services that answer questions for other services like "is this customer a good credit risk" or "what discount should I give this customer for this order or "what's the best cross sell for this customer at this time. These decision services can be very effectively built using a rules management system and allow for easy integration of analytics over time, something many decisions benefit from.

提交回复
热议问题