A
Andy
Hi all,
This is more of a design question. I'm building an n-tier application,
and the question revolves around the buisness layer telling the
application that a value is not appropriate for whatever reason.
What is the recommended way of doing this?
Thrown an exception of a property is assigned a bad value? Throw an
exception when a method is called that needs to use that value? Create
a method that will indicate via a return code if the data is valid (and
if thats how to do things, how do you tell the application which value
is incorrect)?
What if for one application you need to validate the field as soon as
the user tries to move to the next field, and another (like an asp.net
page) you valid the record when save is click?
Thanks for any suggestions!
Andy
This is more of a design question. I'm building an n-tier application,
and the question revolves around the buisness layer telling the
application that a value is not appropriate for whatever reason.
What is the recommended way of doing this?
Thrown an exception of a property is assigned a bad value? Throw an
exception when a method is called that needs to use that value? Create
a method that will indicate via a return code if the data is valid (and
if thats how to do things, how do you tell the application which value
is incorrect)?
What if for one application you need to validate the field as soon as
the user tries to move to the next field, and another (like an asp.net
page) you valid the record when save is click?
Thanks for any suggestions!
Andy