A
Adie
Hi, wonder if anyone could give me some code advice.
I'm wondering about the best way to validate if all inputs are present
and correct for object creation in an ASP.NET application.
Not sure how to explain this, but I really want to separate the
interface from the business logic as I may eventually move to windows
forms. So I really don't want to validate on the form inputs, rather
in the class's.
So say I provide too few initialisers for class creation, I want the
object to not create itself and somehow return null or something, so
that I can pass this along to the GUI and the user be informed.
I thought maybe using something akin to the code in the singleton
pattern, where the constructor is protected and called from an
initialisers method, which could do the validations. But I'm not sure
and am really curious as to how experienced developers tackle this
sort of problem.
I'm wondering about the best way to validate if all inputs are present
and correct for object creation in an ASP.NET application.
Not sure how to explain this, but I really want to separate the
interface from the business logic as I may eventually move to windows
forms. So I really don't want to validate on the form inputs, rather
in the class's.
So say I provide too few initialisers for class creation, I want the
object to not create itself and somehow return null or something, so
that I can pass this along to the GUI and the user be informed.
I thought maybe using something akin to the code in the singleton
pattern, where the constructor is protected and called from an
initialisers method, which could do the validations. But I'm not sure
and am really curious as to how experienced developers tackle this
sort of problem.