[翻译]The Data Access Application Block

Enterprise Library 4.1 - October 2008

The Data Access Application Block

数据访问应用块

The Enterprise Library Data Access Application Block simplifies development tasks that implement common data access functionality. Applications can use this application block in a variety of situations, such as reading data for display, passing data through application layers, and submitting changed data back to the database system. The application block includes support for both stored procedures and in-line SQL. Common housekeeping tasks, such as managing connections and creating and caching parameters, are encapsulated in the application block's methods. In other words, the Data Access Application Block provides access to the most often used features of ADO.NET in simple-to-use classes; this boosts developer productivity.

企业库数据访问应用程序块简化了开发任务,实现共同的数据存取功能。应用程序可以在以下各种情况使用这个应用程序块,如为显示而读数据,通过数据应用层,和提交变更数据备份到数据库系统。该应用程序块包括支持存储过程,以及嵌入式SQL 。共同的计算机操作任务,如连接管理,创建和缓存参数都封装在应用程序块的方法。换句话说,数据访问应用程序块提供了调用最常用的功能ADO.NET在简单易用的类,这提高开发人员的工作效率。

ADO.NET 2.0 provides classes such as the DbCommand class and the DbConnection class; these classes help to abstract the data provider from any particular database implementation. The Data Access Application Block takes advantage of these classes and provides a model that further supports encapsulation of database type–specific features, such as parameter discovery and type conversions. Because of this, applications can be ported from one database type to another without modifying the client code. The Data Access Application Block includes an abstract base class that defines a common interface and that provides much of the implementation needed by the data access methods available in ADO.NET 2.0.

ADO.NET 2.0提供类如DbCommand类和DbConnection;这些类有助于抽象数据引擎来执行任何特定的数据库。数据访问应用程序块可以利用这些类和提供了一个模式,进一步支持封装数据库类型的特定功能,如参数发现和类型转换。由于这一原因,应用程序也可以从一个数据库移植到另一个类型而不需要修改客户端代码。数据访问应用程序块包括一个抽象基类,它定义一个共同的接口,并提供了执行所需要的数据访问方法提供ADO.NET2.0

The application block also includes classes that are specific to Microsoft SQL Server, Microsoft SQL Server CE, and Oracle. These classes perform operations that are particular to the database type. The code for applications written for one type of database, such as SQL Server, looks much the same as the code for applications written for another type of database, such as Oracle.

该应用程序块还包括支持特有的微软SQL Server ,微软的SQL Server CEOracle 的类。这些类执行特殊的数据库类型操作。应用程序的代码是哟一种数据库类型编写,如SQL Server ,其看起来大致相同的代码编写的应用程序的另一种类型的数据库,如Oracle

Another feature of the Data Access Application Block is that application code can refer to particular databases by an ADO.NET connection string name, such as "Customer" or "Inventory." The application code can specify a named instance of a database and pass this parameter to the DatabaseFactory.CreateDatabase method. Each named database has its connection information stored in a configuration file. By changing the settings in the configuration file, developers can use their applications with different database configurations without recompiling their code.

The Data Access Application Block provides the following benefits:

另一个特点是数据访问应用程序块是应用程序代码可以参照特别是数据库的ADO.NET连接字符串名称,如“Customer”“Inventory” 。应用程序代码可以指定命名实例的数据库,并通过此参数的DatabaseFactory.CreateDatabase方法。每一个命名数据库,其连接信息存储在一个配置文件。通过改变设置在配置文件中,开发人员可以使用自己的应用软件与不同的数据库配置没有编译的代码。 数据访问应用程序块提供了以下好处:

l   It uses the functionality provided by ADO.NET 2.0 and with it, you can use ADO.NET functionality along with the application block's functionality.

l   It reduces the need to write boilerplate code to perform standard tasks.

l   It helps maintain consistent data access practices, both within an application and across the enterprise.

l   It reduces difficulties in changing the database type.

l   It relieves developers from learning different programming models for different types of databases.

l   It reduces the amount of code that developers must write when they port applications to different types of databases.

l   它使用提供的功能和ADO.NET 2.0 ,您可以使用ADO.NET的功能与应用程序块的功能。

l   它减少了需要编写样板代码,执行标准的任务。

l   它有助于保持一致的数据访问的做法,都在一个应用程序和整个企业。

l   它降低了困难改变数据库类型。

l   它免除开发商学习不同的编程模型对不同类型的数据库。

l   它减少了大量的代码,开发人员必须编写应用程序时,端口为不同类型的数据库。

This section includes the following topics:

本节包括以下主题:

l   Introduction to the Data Access Application Block

l   Developing Applications Using the Data Access Application Block

l   Key Scenarios

l   Design of the Data Access Application Block

l   Extending and Modifying the Data Access Application Block

l   Deployment and Operations

l   Data Access QuickStart

l   数据访问应用程序块介绍

l   使用数据访问应用程序块开发应用程序

l   关键情景

l   数据访问应用程序块设计

l   扩展和修改数据访问应用程序块

l   部署和操作

l   数据访问快速入门

More Information

更多信息

For more information, see the following resources:

更多信息参见一下资源

l   Application Architecture for .NET: Designing Applications and Services

l   .NET Data Access Architecture Guide

l   INFO: Microsoft Guide for Designing Data Tier Components and Passing Data Through Tiers

l   Improving Web Application Security: Threats and Countermeasures

l   Improving .NET Application Performance and Scalability

l   .net应用架构:设计应用程序和服务

l   .net 数据访问框架手册

l   信息:设计数据层组件和穿透数据层的微软手册

l   改善WEB应用安全:威胁和策略

l   改善.net应用性能和灵活性

posted @ 2009-05-30 09:55  cspfeng  阅读(368)  评论(0编辑  收藏  举报
测试