Snake
Snake

Reputation: 455

Guidelines for implementing a rule engine

What could be the reasons to implement your own rule engine instead of using an existing commercial/open source one? Any specific guidelines for implementing rule engines?

Upvotes: 12

Views: 7739

Answers (1)

rogermushroom
rogermushroom

Reputation: 5586

See this post for argument for implementing your own:

Rules Engine - pros and cons

mainly the problem centers around the anemic data model anti-pattern. as described here:

http://martinfowler.com/bliki/AnemicDomainModel.html

How you should implement depends very much on the requirements but generally important points to consider when designing your own include.

  • Make the ability to add rules dynamic. So you don't have to shut down the system to edit rules.
  • Match the rules syntax to the appropriate user level, don't expect a secretary to be writing SQL.
  • Take advantage of your domain knowledge to implement your domain models which you will run your rules against.
  • Drools is a good bit of software, try to learn lessons from how that was implemented.
  • Try to modularize your rules engine so it functions independent of any business process tools you might be using

Upvotes: 9

Related Questions