日期:2012-06-25  浏览次数:20774 次

Designing and implementing a versatile data access tier for an ASP.NET application
By Paul Abarham

In this article, we will drill down deeper in to the design of a n-tier architecture and our focus will be on the data access tier (DAT)

Abstract



设计并实现用于ASP.NET一个通用的数据存取层应用程序

作者 Paul Abarham 翻译 cwxiao888@163.com



在此文中,我们将深入研究n-tier架构的设计,而且我们将聚焦于DAT (DAT,data access tier) 。

摘要



In this article, we will drill down deeper in to the design of a n-tier architecture and our focus will be on the data access tier (DAT) (Figure 0).Our goal is to design and implement an appropriate data access tier(DAT) for scalable, reliable and interoperable web application. I have divided this article in to two major parts. In the first part, we will discuss about architectural goals, typed DataSet, EventLogs and HttpModules, which are helpful to understand the second part of this article . We will build in the second part a small(but fine) n-tier application and our focus will be on design and implementation of data access tier. You need a SqlServer (database: Northwind) and VS.net to follow this article.

在此文中,我们将深入研究n-tier架构的设计,而且我们将聚焦于DAT (DAT,data access tier) (Figure 0) 。我们的目标是设计并实现一个可升级的可靠并且相互协同DAT网络应用程序。我已将本文分成两个主要的部分。 在第一部分中,我们将讨论有关于架构的目的,typed DataSet,EventLogs和HttpModules,这有益于理解本文的第二部分。 在第二个部分中我们将创建一个小的(但是很好) n-tier应程序,而且我们的焦点集中在在设计和实现DAT。 你需要一个SqlServer (数据库:Northwind )和VS.net来跟随本文进行操作。

Contents:内容

1. Designing Goals of a data access tier(DAT)DAT的设计目标

1.1 Architectural Goals 架构目标

1.2 Installation of the prototype prototype的安装

1.3 Typed DataSets

1.4 Event Logs

1.5 HttpModules

2.0 Implementing versatile data access tier(DAT) 实现通用的DAT

2.1 Implemeting a super class for data access tier. 实现一个用于DAT的超类(super class)

2.2 A performance test to evaluate SqlDataReader and DataSet objects in the business tier.

评估商业层(business tier)中SqlDataReader 和 DataSet对象的性能测试

2.3 How can I extend this data access tier (DAT) to access multi-databases.

我如何才能扩展此DAT至存取多层数据库(access multi-databases)

2.4 How can I apply database transactions with different isolation level?

我如何应用不同隔离等级(different isolation level)的数据库处理(database transactions)?

2.5 How can I insert and retrieve images?

我怎样插入和检索图象?



Figure 0 shows us a typical 3 Tier Application that is dissected in to three major disjunctive layers, which are data tier (DA),middle tier and presentation tier (PT).

Figure 0给我们展示了一个典型的3 Tier应用,它被分成三个主要的分离层,data tier (DA),middle tier 和 presentation tier (PT)。



If you are not familiar with n-tier architecture, I like to recommend following articles.

http://www.c-sharpcorner.com/Tutorials/Building3TierAppPA.asp

http://www.c-sharpcorner.com/Code/2002/June/AdoNetWinDNAPerspective.asp

如果你对n-tier架构不太熟悉,我给你推荐下列文章。

http://www.c-sharpcorner.com/Tutorials/Building3TierAppPA.asp

http://www.c-sharpcorner.com/Code/2002/June/AdoNetWinDNAPerspective.asp



1. Designing an appropriate data access tier (DAT)

1.0 Architectural Goals

The must requirements of an enterprise application can be expressed through the following buzzwords

Interoperability and Extendibility

Scalability and Performance

Reliability and Manageability

Security

Let us look some of the buzzwords closer, what do they really mean?

Interoperability deals with the ability of a system to communicate with other internal or external systems in a heterogeneous environment . This is a very important issue, because we need information to act just in time to meet needs of our customers and business partners. To achieve this important goal, our system must able to offer and consume we