Subject: When To Create Datasets
Posted By: AspNetGuy Post Date: 7/3/2008 8:22:07 AM
I have not been able to locate an article or tutorial that addresses this question so if you know where I can find an answer I would be greatly appreciative.  This is a question regarding best practices for datasets.

I know what a dataset is and what a DataTable and TableAdapters are.  I have done the exercises.  I have completed a couple of tutorials regarding creating a Data Access Layer where a single dataset was used for the entire Data Access Layer.  So my question is less technical and more philosophical or architectural in nature.

The question, "How many datasets should a project have?" is like asking how long is a string?  But more to the point then, is the question, "when do you choose to create yet another dataset?"

Suppose you have a database with 50-80 tables.  There are relationships among some of the tables.  Do you use one dataset or many?  What is the criteria for creating the next dataset?  What do you use as criteria for limiting the number of tables in a dataset?  Why would I put this table and that table into a dataset and not some other table?

Thanks to any and all who might answer this.

Reply By: peace95 Reply Date: 7/4/2008 12:01:52 PM
 AspNetGuy:
Your question seem to be a bit confusing because it lacks descriptive database type information. For instance, in your question referencing the 50-80 tables in a database with relationships among some of the tables, you don't say whether it is a RDBMS (Relational Database Management System) or not. Without knowing the database type, the collection of tables could well be a Data Warehouse using a "Star" or "Snowflake" -Type schema. If that is the case, your questions would be null and void.  

Outside of that, my following comments are based on the the definitions on page 10 of Chapter 1, Review of Terminology in the Beginning ASP.NET 2.0 and Databases. Review the definition of a DataSet, Data store and Database or RDBMS. Then turn to page 16 and review the section on "Nonrelational Stores of Data". A database, whether it is Nonrelational or Relational is a DataSet. So your Project may have multiple DataSets, based on project requirements.

A Relational Database consists of multiple tables and this collection of tables and their data is 1 DataSet.  A Nonrelational Database is a data-file(data store) and 1 DataSet. An example of this type of database and data-file is an XL-file(Excel) and 1 DataSet. However an XL-Workbook, which consists of multiple XL-spreadsheets is still 1 DataSet.

Hope this helps.

peace95


========================
Disclaimer:  The above comments are solely the opinion of one person and not to be construed as a directive or an incentive to commit fraudulent acts.
Reply By: AspNetGuy Reply Date: 7/6/2008 7:48:58 AM
Peace95,

Thanks for the information, but it doesn't really address my question. probably due to my poor communication skills.

In answer to your question about database, the database is a SqlServer database.

I can create one dataset when working with one or more databases.  I may also create more than one dataset.  I am not speaking of objects here, but rather dataset definitions.  While I CAN have one dataset I MAY have more dataset definitions.  The question I am posing, which comes from a wealth of ignorance on the topic, is not whether I CAN but whether I SHOULD create multiple dataset definitions?  Are there any performance reasons or design reasons for creating multiple dataset definitions?

Thanks again for any help anyone might give?


Go to topic 72313

Return to index page 1