Читать книгу C# 2010 Coding Briefs Data Access - Kevin MD Hough - Страница 9

Оглавление

Designing the Data Access Framework

For a data access framework to be useful and effective, it must be easy for the developer to use, and flexible enough to accommodate all types of data access requests. The data access framework in Coding Briefs solves both those important issues.

Figure 1: Basic Data Access Flow, as shown below, depicts the basic flow of the data access framework.


Figure 1: Basic Data Access Flow

The DAL of Coding Briefs Data Access Framework is designed to perform two major tasks:

•Select records

•Execute actions against records

Selecting Records

A well designed DAL will allow the developer to select records and return them in a container, such as a DataSet, or a SqlDataReader. The DAL that we will develop for Coding Briefs is no exception. It will allow us to select records and return the selection as a DataSet or a SqlDataReader.

Executing Records

Coding Briefs’ DAL provides functionality to execute an action type stored procedure. Action stored procedures are those that insert records, update records, or delete records from a database. For execution, the number of affected row is returned. So now that we have a high-level view of the functionality of the DAL, it is time to jump in and get started developing it.

In the next section, we will get the sample applications up and running.

C# 2010 Coding Briefs Data Access

Подняться наверх