That's certainly a good start. The other thing with rules engines is that some things are well-understood, deterministic, and straight-forward. Payroll withholding is (or use to be) like that. You 可以 express it as rules that would be resolved by a rules engine, but you could express the same rules as a fairly simple table of values.
The one poit I've noticed to be "the double edged sword" is:
把逻辑交给非技术人员
I've seen this work great, when you have one or two multidisciplinary geniuses on the non technical side, but I've also seen the lack of technicity leading to bloat, more bugs, and in general 4x the development/maintenance cost.
BASICALLY do NOT use a rules engine if you have a simple ruleset and can have a groovy interface instead.....just as dynamically deployable and new developers joining your team can learn it faster than the drools language.(but that's my opinion)
我是业务规则引擎的忠实粉丝,因为它可以帮助您作为一个程序员的生活变得更加轻松。我在从事数据仓库项目时的第一次经历之一是发现存储过程包含复杂的 CASE 结构,这些结构延伸到整个页面。调试是一场噩梦,因为很难理解在如此长的 CASE 结构中应用的逻辑,也很难确定代码第1页的规则和第5页的规则之间是否有重叠。总的来说,我们在代码中嵌入了300多条这样的规则。
When we've received a new development requirement, for something called Accounting Destination, which was involving treating more than 3000 rules, i knew something had to change. Back then I've been working on a prototype which later on become the parent of what now is a Custom Business Rule engine, capable of handling all SQL standard operators. Initially we've been using Excel as an authoring tool and , later on, we've created an ASP.net application which will allow the Business Users to define their own business rules, without the need of writing code. Now the system works fine, with very few bugs, and contains over 7000 rules for calculating this Accounting Destination. I don't think such scenario would have been possible by just hard-coding. And the users are pretty happy that they can define their own rules without IT becoming their bottleneck.
Still, there are limits to such approach:
You need to have capable business users which have an excellent understanding of the company business.
You need to have an application used for rules authoring, in which
实现了重叠业务规则的检测算法。否则,你最终会搞得一团糟,没有人再理解他们得到的结果。
When you have a bug in a generic component like a Custom Business Rule Engine, it can be very difficult to debug and involve extensive tests to make sure that things that worked before also work now.