Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Objects Validation and Business Rules Validation
    text
    copied!<p>I am developing application having business objects created from EF 4.0. The application is layered with Data Layer having repository of classes. Above that is a business layer where business processes are mapped as per the requirements. Business layer is calling data layer.</p> <p>Business objects have complex associations. One scenario: Merchant has Multiple Addresses Merchant belongs to one Category Merchant has an Account Account has a Wallet</p> <p>User will be creating a new merchant along with above mentioned business objects (graph). There are various business rules when creating and updating a merchant.</p> <p>I would like to split my validations into two sub sections. 1) Scalar Property Validation to be handled by Validation Blocks 5.0 and 2) Business Process Rules Validation to be handled in business layer components. However, i am facing difficulty on having a centralized way to report broken rules (Scalar Properties validation and Business Process Rule Validation). I don't want to inject exceptions everywhere where business rule in is violated as per the business process mapped.</p> <p>One e.g is following: When creating a new merchant, Category needs to be validated. Because if a certain type category is associated with this new merchant then business rule says that such merchant cannot exists twice in the system.</p> <p>Now, when a UI pass the new merchant graph to business layer component, i first validate BO Scalar properties validation (validated bu Validation Blocks) then this BO is passed into business process rule validation methods to check various rules. There are possible violation points which i want to report and shall not allow the merchant and graph objects to be persisted.</p> <p>Please share any value able design approach to manage centralized validation rule logging and reporting to UI layer.</p> <p>EDIT: I don't want to incorporate validations on EF SaveChanges, ChangeAssociation etc event handlers. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload