4-Tier Architecture in ASP.NET with C#

I am using 3-Tier architecture in my different projects, but adding a 4th tier is a novelty for me.

After reading this article, I can see the benefits to add a Business Access Layer in some complex scenarios.

From the author:

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]

Read more...

 

4 Comments

  • This is fairly similar to the model you get with Linq to SQL, where the DataContext is your BAL which is seperate from the Entities are your BO's. While purists my balk, Linq to SQL can provide a nice compromise approach between logical and physical seperation of the tiers, much as this example is doing.

  • 4-Tier has been around a long time. The 4th Teir (BO) was really invented in the C days with the .h file.

    I use it constantly as it cuts down on the amound of memory needed to move around objects.

    Define all your Entities (What you call BO) as a skeleton of your object. The properties and variables. Then have your main BAL object inherit that. You can now easily transfer that entity around, without having the need to pass Logical information around with it.

    Works like a charm.

  • his sql queries should have used parameters.

  • I always use a 4-tier model but I use UI, BD (Business Delegate), DTO (Data Transfer Objects), and DAL. Same concept just naming syntax is different.

Comments have been disabled for this content.