S
sourabh
Hi
I have a basic qus. I am writing a middle-tier component. I have constructor
which takes 3 inputs, here's how it looks
internal ClassName(Database dbToUse, Int64 pk,DateTime Date)
{
}
Now , i want to know should I validate all the inputs before i start using
them, and if so in case of an invalid error whats the best way to report
error. Here on invalid input if I dont initialize the object and return, it
would return a object without any valid fields / memebrs.
Whats th general practice for these type of implementations. Is it feasible
to throw an exception?
-Sourabh
I have a basic qus. I am writing a middle-tier component. I have constructor
which takes 3 inputs, here's how it looks
internal ClassName(Database dbToUse, Int64 pk,DateTime Date)
{
}
Now , i want to know should I validate all the inputs before i start using
them, and if so in case of an invalid error whats the best way to report
error. Here on invalid input if I dont initialize the object and return, it
would return a object without any valid fields / memebrs.
Whats th general practice for these type of implementations. Is it feasible
to throw an exception?
-Sourabh