Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What would you use for a business validation layer?

In my project I need to create a business object validation layer that will take my object and run it against a set of rules and return either pass or fail and it's list of failure reasons. I know there are quite a few options out there for accomplishing this.

From Microsoft:

  • Enterprise Library Validation Application Block
  • Windows Workflow Foundation Rules Engine

Open Source:

  • Drools.NET
  • Simple Rule Engine(SRE)
  • NxBRE

Has anyone had any particularly great successes or failures with any of these technologies (or any that I didn't list) or any opinions on what they feel is best suited for business rules validation.

Edit: I'm not just asking about generic validations string length < 200, zip code is 5 digits or 5+4 but assume that the rules engine would actually be leveraged.

like image 835
Chris Marisic Avatar asked Feb 07 '09 21:02

Chris Marisic


People also ask

What are the two types of validation?

The guidelines on general principles of process validation mentions four types of validation: A) Prospective validation (or premarket validation) B) Retrospective validation. C) Concurrent validation.

Is validation part of business logic?

Business logic tier validation assumes existing data is valid. The business logic tier employs validation logic when it needs to create or change data, but it assumes that data already in the table is valid.

What is the meaning of business validation?

What Is Market Validation? Market validation is the process of determining if there's a need for your product in your target market. Validating your business idea can enable you to reasonably predict whether people will buy your product or service, and whether your business will be profitable.

Where should validation take place?

Data validation should occur in two locations: The point where data is acted upon, for example validating input parameters to an SQL query. General validation at the point where data is submitted, for example in a web application some validation should occur on the client.


1 Answers

The code-versus-rules-engine decision is a matter of trade-offs, IMHO. A few examples are:

Advantages of code

  • Potentially higher performance.
  • Uses developers' existing skills.
  • No need for separate tools, run-time engines, etc.

Advantages of rule engine

(Features vary across the various rule engines.)

  • Rule DSL that is writable (or at least readable) by business users.
  • Effective- and expiration-date properties that allow automatic scheduling of rules.
  • Flexible reporting from rule repository supports improved analysis and auditing of system behavior.
  • Just as data-base engines isolate data content/relationship issues from the rest of the system, rules engines isolate validation and policy from the remainder of the system.
like image 117
joel.neely Avatar answered Oct 05 '22 20:10

joel.neely