Tuesday, May 06, 2008

4-Tier Architecture in ASP.NET with C#

Code Updated on 21st April 2008 to support Sorting, Paging and data manipulation through Stored Procedure in DAL

Almost all of us must have heard about 3-Tier architecture but what is this 4-Tier architecture? What are the benefits and how it is different from other architectures?

Well, the architecture I am going to demonstrate here is just enhancement of 3-Tier archicture. In this architecture; you no need of writing long function parameters throughout the layers (as in traditionally 3-Tier archicture has to) and the actual objects of the application will be in a separate tier so that in future you can separately use these objects for enhancements. Change in the object definition can be done without touching the entire Business Access Layers ............

Let me explain you step-wise process of creatioin of 4-Tier architecture application.

In this application, I am going to take example of a Person that will have 3 properties: FirstName, LastName, Age. We will create a separate pages to insert these records (default.aspx) into database and list,update,delete records (list.aspx) from database. In this application we will have following 4-Tiers

1. Business Object [BO]
2. Business Access Layer [BAL]
3. Data Access Layer [DAL]
4. UI (4-Tier) folder [UI]

Picture - 1 (Solution Explorer)

For original article visit http://www.dotnetfunda.com/articles/article18.aspx

1 comment:

Antonio said...

Thanks for very useful information. I am starting using layers in my application and this article is really very good at explaining things. Business object tier is for me the real revelation, because it further simplifies architecture as whole.