This is the third in a series of four tutorials that introduces ASP.NET 2.0 and Microsoft's Visual Web Developer Express IDE for building Web applications. The Visual Web Developer Express functionality we discuss is also part of the complete Visual Studio 2005. Both Visual Web Developer Express and Visual Studio 2005 are scheduled to be released in November 2005. This series of tutorials is a small part of Chapter 21, ASP.NET, Web Forms and Web Conrols, from our forthcoming book Visual Basic 2005 How to Program, 3/e. Chapter 21 is part of a four chapter sequence on XML, ADO.NET, ASP.NET and Web Services in which we discuss each of these technologies and demonstrate how to build substantial, data driven Web applications.
Part 1 provided a brief introduction to ASP.NET, Web Forms and Web controls. Part 2 discussed simple HTTP transactions that enable client/server interactions on the Web. This part overviews multitier application architecture. Part 4 presents a simple Web Form example, analyzes its parts, shows how it executes, and discusses how to build and deploy the Web Form. The tutorials in this series are intended for students and professionals who are already familiar with Visual Basic .NET programming. These tutorials are intended for students and professionals who are already familiar with Visual Basic .NET programming.
[Note: This series of tutorials is an excerpt (Sections 21.1-21.4) of Chapter 21, ASP.NET, Web Forms and Web Controls, from our forthcoming textbook Visual Basic 2005 How to Program, 3/e. These tutorials may refer to other chapters or sections of the book that are not included here.
Permission Information: Deitel, Harvey M. and Paul J., Visual Basic 2005 How to Program, ©2005.
Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle River, New Jersey.]
Part 3: Multitier Application Architecture
Web-based applications are multitier applications
(sometimes referred to as n-tier applications
). Multitier applications divide functionality into separate tiers
(i.e., logical groupings of functionality). Although tiers can be located on the same computer, the tiers of Web-based applications typically reside on separate computers. Figure 21.3
presents the basic structure of a three-tier Web-based application.
The information tier
(also called the data tier
or the bottom tier
) maintains data pertaining to the application. This tier typically stores data in a relational database management system (RDBMS). We discussed RDBMSs in Chapter 20. For example, a retail store might have a database for storing product information, such as descriptions, prices and quantities in stock. The same database also might contain customer information, such as user names, billing addresses and credit-card numbers. This tier can contain multiple databases, which together comprise the data needed for our application.
The middle tier
implements business logic
, controller logic
and presentation logic
to control interactions between the application's clients and the application's data. The middle tier acts as an intermediary between data in the information tier and the application's clients. The middle-tier controller logic
processes client requests (such as requests to view a product catalog) and retrieves data from the database. The middle-tier presentation logic then processes data from the information tier and presents the content to the client. Web applications typically present data to clients in the form of XHTML documents.
Business logic in the middle tier enforces business rules
and ensures that data is reliable before the server application updates the database or presents data to users. Business rules dictate how clients can and cannot access application data and how applications process data. For example, a business rule in the middle tier of a retail store's Web-based application might ensure that all product quantities remain positive. A client request to set a negative quantity in the bottom tier's product-information database would be rejected by this business logic in the middle tier.
The client tier
, or top tier
, is the application's user interface, which gathers input and displays output. Users interact directly with the application through the user interface, which is typically a Web browser, keyboard and mouse. In response to user actions (e.g., clicking a hyperlink), the client tier interacts with the middle tier to make requests and to retrieve data from the information tier. The client tier then displays the data retrieved from the middle tier to the user. The client tier never directly interacts with the information tier.
Tutorials in This Series:
ASP.NET Tutorial Part 1: Introduction to ASP.NET
ASP.NET Tutorial Part 2: Simple HTTP Transactions
ASP.NET Tutorial Part 3: Multitier Application Architecture (You are here.)
ASP.NET Tutorial Part 4: Creating and Running a Simple Web Form Example