I am developeing a product which is based on layered archicteture(DAL, Business, Service, Presentation). Now i need to develop a business rule engine so that each client related rule can specify there. My business logic code use this user defined rule and work based on this. If any business rule violated i can throw BusinessException whih is my customException.
I am new to this concept. Kindly guid to design this rule engine architecture to work this product as a dynamic one..Give your suggestions and ideas related to this and how can i implement this?
Any .net side implemetation or conecpt related to this?
- Edited by akhilrajau Tuesday, February 21, 2012 4:17 PM
I believe you are searching this:
also refer to the links on the article under "In This Section"
Vidya Vrat Agarwal. http://dotnetpassion.blogspot,com
Some guidelines that i can think of: -
a) Business rules can be centralized and modularized as per need to facilitate reuse.
b) Validation logic can accept rule sets (collection of rule objects) and data entity to perform validation, loose couple them (i.e. irrespective of what entity or what rules are used).
c) A validation can be a bulk validation or single validation. Make sure that you return validation results as a collection of result of each validation applicable.
d) All validation results to carry some custom data that help UI in relating the validation to the specific UI elements. Helpful when communicating across service layer too.
e) Same entity can have different rule sets under different conditions. Facilitate dynamic creation of rule sets.
f) Business layers may require to fetch data repeatedly from DAL to validate in some conditions. Try to make these as efficient as possible.
also can have a glance at this:- Designing Business Rules
- Edited by venkyzealous Wednesday, February 29, 2012 10:50 AM
You do not actually have to use any workflows to use the BRE. You can just create a SerializedRuleSet based on your custom rule logic, and evaluate it against the BRE.
I've done this before by using the CodeDOMParser library to help serialize custom rulesets, then evaluate each ruleset using a RuleEngine. You can use the BRE just like any other third-party library, from your standard C# code.
Check out My Blog. Now updated to actually work!