Framework / Design pattern for business rule validation
Solution 1
drools framework is specifically designed to evaluate business rules
spring framework allows writing beans using dynamic languages like groovy and jruby. You can easily plug JavaScript
strategy design pattern seems like a good fit: implement each rule as a separate strategy and run them one after another.
similar chain of responsibility pattern can be used: each rule either fails or succeeds and passes control to next rule
Solution 2
A good pattern to implement business rules is the Specification pattern. It's a combination of Strategy, Composite and Interpreter that can make for parameterized and easily combinable rules. Be sure to also look at the original paper (pdf) by Fowler and Evans, and take a look at the book Domain Driven Design if you can.
ilovetolearn
Updated on June 05, 2022Comments
-
ilovetolearn almost 2 years
What kind of framework / design pattern should I use for application which possibly has 1000 over biz rule validations?
The type of systems I am working on consist of lots of input forms which allow users to enter. Each input form has different sections.
i.e. Form A has Section A/B/C/D. Form B has section B/C/D
Some of these biz rule validation are common to both forms, I am looking at a approach to reuse the rules as well.
How do I build a robust business rule validation framework?