views:

77

answers:

2

Hello. I am unsure if this question qualifies to be here but I cannot think of a better place to go.

I am building a web application that has multiple alternative paths to most of the use cases. These paths I perceive as business rules. I would like to code my application first for main scenarios and then apply alternative scenarios as business rules (rules can be added and removed even when application is in production).

I think my application deserves a rule engine. I haven't used any in the past. So I have few queries, but before that here is the profile of my application:

  • Web based application (data intensive)
  • Somewhat critical (related to health care) - dynamism needs to be accounted for
  • Microsoft .Net platform (ASP.Net, MS SQL Server, WCF)

Here are some queries:

  • How best to externalize rules?
  • Is it possible to apply rules immediately or batch-wise is the only possibility?
  • How can Business User be in control of rules?
  • What best (suitable) rule engine is there? (I prefer to accommodate an open source product)

Any additional experience is welcome as I am still drilling into the needs.

A: 

Windows Workflow Foundation

Barry
+1  A: 

There are many business rules engines available for ASP.Net; Windows Workflow Foundation, BizTalk Business Rule Engine, Solver Foundation, Stream Insight, and Reactive Framework. Google reveals many more, such as Simple Rule Engine and Custom Rule Engine.

If there are many solutions to a problem, that is a clue none of them are any good, and that has been my experience using rule engines. I investigated WWF, and my experience was that implementing the engine and defining rules was more difficult and error-prone than simply coding the rules in the application logic.

I discourage binary-format or graphical DSLs. In my experience they are very hard to change, debug, search, and maintain.

My advice is to implement the rules in a familiar, end-user-understandable, domain-specific, text-based language. Which language will depend on what domain you are working in, and what languages your end-users are familiar with. Investigate competing products and implementations to see what is already being used in your domain.

Dour High Arch
Thanks friend. I was carrying a similar viewpoint, but yours has surely reinforced it. Considering that my application is more a product than just a website, I better get on with building one that is focused and specific to my domain.
Kabeer