Kevin,
>I'm not sure I'm in agreement with you and Bonnie as to where to put the validation code, and here's why. What if you get all the validation code complete and your boss decided to rebuild the app from WinForms to ASP.Net? Now you have you move all the validation code.In my example, the validation is NOT in the UI ... the UI simply has a way of indicating that there's a problem by changing the color of the invalid control. It would be done differently in ASP.NET (indicating where the problem is), but it would still be finding the problem by calling CheckRules methods in the Rules classes.
All the checking for this invalid stuff is done in the Rules classes, which are NOT visual. Re-read what I wrote.
~~Bonnie
>I'm not sure I'm in agreement with you and Bonnie as to where to put the validation code, and here's why. What if you get all the validation code complete and your boss decided to rebuild the app from WinForms to ASP.Net? Now you have you move all the validation code.
>
>My question was more to the issue of how to deal with a property that isn't set or is incorrect? Do you throw an exception, or maybe
>set some property that tells what the issue is? Then, any other class or UI that's using is can check it.
>
>If you create a cusom exception for each required property, then throw the error, your UI's error handling scheme would catch it.