E
Eric
If you have a Windows Forms application, how do you divide up the logic
among the presentation, business and data access layer?
I have usually done the controls in the form/user control, who make calls to
the data access layer to get data and load it into the form controls.
There's still a bit of logic in the forms, but some co-workers are saying
that virtually all logic, even calling data access objects, should be moved
out to a business object layer. I'm curious as to what people think.
It's something like this:
Form1
OnLoad()
{
DataSet ds = DataAccess.CustomerTable.GetCustomerList();
dataGrid1.DataSource = ds;
}
And the CustomerTable object makes calls to the actual DB to get data.
I'm not sure it's a win to move stuff like this out of the form, and there
must be some event processing logic in it anyway.
Discussion welcome.
Eric
among the presentation, business and data access layer?
I have usually done the controls in the form/user control, who make calls to
the data access layer to get data and load it into the form controls.
There's still a bit of logic in the forms, but some co-workers are saying
that virtually all logic, even calling data access objects, should be moved
out to a business object layer. I'm curious as to what people think.
It's something like this:
Form1
OnLoad()
{
DataSet ds = DataAccess.CustomerTable.GetCustomerList();
dataGrid1.DataSource = ds;
}
And the CustomerTable object makes calls to the actual DB to get data.
I'm not sure it's a win to move stuff like this out of the form, and there
must be some event processing logic in it anyway.
Discussion welcome.
Eric