|
-
December 10th, 2008, 05:59 PM
#32
Re: Object Validation
Well the reason I decided not to have a validator is because some fields cannot be validated. For example:
In my Department class to tell if the class is taxable or non-taxable. I don't know how to validate that, because its a boolean and it can never be invalid. It can't be assigned to null and it is guranteed to always be true or false. I don't see how that could be invalid.
So if I were to validate that field I would have to check if its either true or false and it will always be one of the two values.
Also, a GUID field I have no way to validate. I just make sure that its not Guid.Empty. But there is no way that a GUID can be invalid either because you would receive a cast exception as soon as you tried to assign it something that is not a real GUID...
So I guess you want me to create a BooleanValidator class and just have that class do nothing??
Three5Eight
Using: MS C# 08 EE, MS SQL 05 EE, C++ .Net 08 EE, Vista Home Premium, XP Home
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|