W
wapsiii
On a asp.net project I'm using generated classes to access the
database. I'm developing business logic classes to handle all business
logic and pass on info to the data access classes. On the code behind
pages of the asp.net pages I simply get the values from the postback
and set the properties of the business classes. Before I pass the
values on the the data access layer to persist the changes I'd like to
check if the required properties have been set correctly.
I'm unsure how best to implement these kinds of checks. Should I
simply add a function to the business layer class called something
like:
function isReadyToPersist() as boolean
and do my checks here? Something like:
if me.PersonId = 0 then
return false
end if
etc.
or is there a better way?
database. I'm developing business logic classes to handle all business
logic and pass on info to the data access classes. On the code behind
pages of the asp.net pages I simply get the values from the postback
and set the properties of the business classes. Before I pass the
values on the the data access layer to persist the changes I'd like to
check if the required properties have been set correctly.
I'm unsure how best to implement these kinds of checks. Should I
simply add a function to the business layer class called something
like:
function isReadyToPersist() as boolean
and do my checks here? Something like:
if me.PersonId = 0 then
return false
end if
etc.
or is there a better way?