Chapter 2: Accessing Data in ADO.NET


This chapter launches your enterprise application development by diving into the heart of any enterprise application, the database. Because the database is indisputably the most important element of any enterprise application, it serves as an ideal starting point for development. This chapter begins by defining the application data access framework and showing how to architect it. Next, the chapter reviews ADO.NET and describes how it fits into the data access framework. It breaks the framework down into its key elements, such as the data access component, the business objects, the business object manager, and the reference data. All examples outline the steps for building the IssueTracker enterprise application, which can translate to just about any enterprise domain.

Building a Data Access Framework

As mentioned in the prior chapter, applying an application framework is important to the success of an enterprise application. A data access framework can ensure scalability, guarantee consistency, and reduce development time in an application. When application developers adopt a uniform framework for data access, they simplify ongoing maintenance and minimize bugs . Figure 2-1 illustrates the data access framework implemented by the IssueTracker enterprise application.

click to expand
Figure 2-1: Data access framework composed of three functional tiers

As illustrated , the data access framework has three logical tiers: the data tier, the business tier, and the presentation tier. The data tier represents the physical database, its tables, and rows of data. You expose this data through stored procedures only.

The business tier manages business objects, or in-memory representations of the underlying data. Figure 2-1 divides the business tier into two categories: application business objects and a DataSet. The business objects, defined within the application, represent business-specific entities, such as an Issue or a User . The DataSet, however, is an ADO.NET-cached collection of tables and rows representing reference data, such as IssueTypes or IssuePriorities.

The presentation tier interacts with the application data through the business objects only. It is completely disconnected from the underlying database. As a result, the underlying database system can switch from Microsoft SQL Server to Oracle to MySQL without changes to the user interface. Similarly, multiple clients may consistently interact with the underlying data ”including Web pages, Web services, Windows forms, and mobile clients ”simply by interacting with business objects.




Developing. NET Enterprise Applications
Developing .NET Enterprise Applications
ISBN: 1590590465
EAN: 2147483647
Year: 2005
Pages: 119

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