Chapter 3. The Data Access Application Block


MOST ENTERPRISE-LEVEL applications store information in some type of relational database. As a result, these applications often need to execute database commands such as Transact-SQL statements or stored procedures. The commands are used to perform database updates, retrieve data values, retrieve multiple rows of data, and even retrieve XML data. The need for this type of functionality is at the core of almost every enterprise-level application.

However, developers often find themselves duplicating code to open and close database connections, assign parameters to database commands, and perform similar database operations throughout the various applications that they build. The Data Access Application Block is designed to address these inefficiencies by providing methods that encapsulate the logic needed to perform the most common database operations with a minimal requirement for custom code. Furthermore, its design provides a consistent interface for performing these database operations regardless of the ultimate data source that is being used.

This chapter begins by explaining the differences between Enterprise Library's Data Access Application Block and the versions of the Data Access Application Block that have preceded it. (One of the major differences is the introduction of database providers.) It discusses the design of database providers and why they are at the core of this version of the Data Access Application Block. It describes how to create a new database provider, complete with design-time capabilities, that extends the ability of the Data Access Application Block to use data sources other than Microsoft SQL Server, Oracle, or DB2.

The chapter then highlights how to configure database providers for an application and how to take advantage of a database provider's methods and properties to access and update data from a database. The chapter concludes by showing how to design the data tier for a distributed application so that it not only takes advantage of the features that Enterprise Library's Data Access Application Block provides, but so it also adheres to the guidance prescribed by the Microsoft patterns & practices team.




Fenster Effective Use of Microsoft Enterprise Library(c) Building Blocks for Creating Enterprise Applications and Services 2006
Effective Use of Microsoft Enterprise Library: Building Blocks for Creating Enterprise Applications and Services
ISBN: 0321334213
EAN: 2147483647
Year: 2004
Pages: 103
Authors: Len Fenster

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net