MasterRacker
New member
thread678-1054016 ended by discussing returning an error collection instead of throwing exceptions. If I have a validation method that returns an object, even if there are no errors, I have to look into the object for a "no error" condition.
I'm thinking about having a validation method that returns a boolean, with false triggering the examination of the error collection. In this arrangement, what's the best way of passing the error collection? The two options I can think of are A) pass an error collection by reference to the validation method to be populated or B) making the error collection part of the object itself.
I can see pros/cons to each method. What's the more generally accepted thinking? Is there a third way that brain death is blinding me to? Is the whole thing a crock and should I only return the error collection directly?
Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
I was not born cynical - I earned my cynicism through careful observation of the world around me.
I'm thinking about having a validation method that returns a boolean, with false triggering the examination of the error collection. In this arrangement, what's the best way of passing the error collection? The two options I can think of are A) pass an error collection by reference to the validation method to be populated or B) making the error collection part of the object itself.
I can see pros/cons to each method. What's the more generally accepted thinking? Is there a third way that brain death is blinding me to? Is the whole thing a crock and should I only return the error collection directly?
Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
I was not born cynical - I earned my cynicism through careful observation of the world around me.