Forum Post: Re: Data Validation Approach

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
The approach I'm thinking about is something like this: A number of Validation classes that each perform some small validation, and potentially return one or more ValidationErrors. Each Validation takes an argument against which to perform the validation code. A Validator type that contains a set of Validation instances and loops through them all, validating and gathering errors as it goes. The Validator type would be where you can add custom/extra validation rules. When a (say) save operation is performed, get an object's Validator and do the validations within. The fun part now is figuring out how to generically associate Validators with other objects.

Continue reading...
 
Status
Not open for further replies.
Back
Top