I got a business object bounds to a form (each property is bound to a control). There is some business specificatios (such as this field should not be empty, this one must be greater than 0 etc…). What is the best way to check all the rules ?
I currently have a validator on each contorl, so I can check for all validator to be ok, but I don’t really like this solution. Indeed the rules are dispached and it’s no easy to see all at once.
I can have a big method CheckValidaty that check for all the rules but this leads to a double check with the validators.
What would you do, other solution ?
I would suggest that let the BusinessObject implement
IDataErrorInfo. I think it is the cleanest way to handle business errors.Take a look at these links: