Data and Business Tier Design

N

news.microsoft.com

I am contemplating creating data access and businesss tier class libraries
and would like some help understanding what problems my design my have.

I am thinking of creating a data access class for each table in my
application. These classes would return a DataTable (not a DataSet) for the
various select statements. The class life would look like this.
1) Constructor creates a DataTable and DataAdapter.
2) Populate DataAdapter with Select, Insert, Update, and Delete commands
3) Fill the DataTable with the DataAdapter.Fill
4) Wrap the DataAdapter and DataTable in a class and return it to the
Business Tier.
5) Dispose

A Business tier class would call a Data Access class in order to add
DataTables to the Business tier class's DataSet. The Business tier class
would manipulate the data and then, because it also has the DataAdapter
associated with the table, could then call the DataAdapter.Update() method.
Is it possible to have on DataSet consisting of DataTables each with its own
DataAdapter?

The reason I want my Business object class to simply add DataTables to it's
DataSet is because I want my Business class to abstact a concept such as
Product as a single object even though a Product in my database is defined
by many tables,( ie. Product,table, ProductType table, and ProductCategory
table.)

Business Tier Class life would look like this:
1) Constructor creates a new DataSet
2) Calls the Product data access class to return Product DataTable and its
DataAdapter, adds Product DataTable to DataSet.
3) Calls the ProductType data access class to return ProductType DataTable
and its DataAdapter, adds ProductType DataTable to DataSet.
4) Calls the ProductCategory data access class to return ProductCategory
DataTable and its DataAdapter, adds ProductCategory to DataSet.
5) Calls Update method for each DataAdapter.
 
J

Joe Fallon

It's a 600 page book!
Chapter one is posted free though.
It was enough to get me to buy the book.
Now I am trying to implement it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top