Business Rule Validation
Justin says:"Something I've been messing around with for the past couple of days is Business Rule Validation. Basically stuff like this - when Foo = 1, then Bar had better equal 2. As well as, when I set Quux to false, then I need to set FoobleDate to current date time. Simple stuff. In the world of .NET, you can do this using properties. In the set portion of the property, do the validation as well as side effects. The validation will throw exceptions if necessary (InvalidOperationException). Some people will probably disagree with me about this (including myself). Personally I believe if setting a property has the side-effect of changing other properties, then it should be in a method. "
I totally sympathize. While I maybe more inclined toward the usefulness of datasets than I have been on previous occassions, your post is a perfect example of why I'm feeling a tad paranoid about my newfound inclination to use DS's. Now if I just had an answer to your problem..... :-)
2:18:05 PM
|
|