This article is written to see the importance of having a separate Data Access layer.
A good data access layer is critical for most business applications, whether that layer resides on a middle-tier application server, a web server, or on the client. Data access layers tend to involve a lot of error-prone, repetitive coding if you try to do it by hand. You can alleviate some of that by designing a good set of base and helper classes to encapsulate the repeating patterns, or by using a code generation tool. However, you still usually have to write all the data access methods by hand for the ad-hoc queries that service large parts of your application.
Now let me talk about the 3 tier architecture
The GUI layer
The GUI is the "top layer". It contains all things that are visible to the user, the 'outside' of the system, such as screen layout and navigation.
- What is the language of the user interface?
- What is enabled and what is disabled?
- Are you using a decimal dot or a decimal comma?
The GUI layer has techniques like HTML, CSS, Applet, Servlet, JSP, JHTML.
The Business layer
This is the core of the system, the linking pin between the other layers. Business-objects and data storage should be brought as close together as possible, ideally, they should be together physically on the same server. This way - especially with complex accesses - network load is eliminated. The client only receives the results of a calculation - through the business-layer of course.
Database Layer
The database layer takes care of persistence. An object from the database layer can write itself to one or more tables. In the database layer, you'll find things like database, connection, table, SQL, and result set.
Advantages
- With the right approach, 3-tier architecture saves development manpower. Code each bit only once, with powerful re-usage.
- Divide and conquer strategy. Every layer is rather easy to develop. Better have 3 simple parts that one complex whole.
- Quality. For each layer, a specialist can contribute specific expertise, a GUI Designer for the user interface, a Java programmer for the object layer, and a Database Designer for the tables.
With this article, I have attached the project for Data layer implementation in c#.

Shashidhar KPosted Feb 20, 2009, 12:56 AM
Can you please let me know how do I deploy this 3 tier Architecture Web Applicaiton? What I mean is I can deploy this in below mentioned different ways: 1) GUI and Business layer in one server and Database on other server. 2) GUI on one server and Business Layer and Database on other server. 3) All 3 layers on 3 different servers 4) All the three on one server. When I need to think about scalability 1) Which would be the best option? 2) If I go with option 2 and have deployed GUI layer in multiple servers(for Load balancing) can you please tell me how will GUI layer access the Business layer? Hope to hear from you soon. Thanks and regards Shashi J K
roushan kumarPosted Feb 27, 2008, 4:57 AM
can u send me a complete small web application in which it has all the three layers,say UI , BL, DAL. for ex. like add,delete,update etc in any emp or cust table.
Paul ScullyPosted Nov 30, 2006, 10:05 AM
The article mentions a Database Layer when it should be talking about the importance of a data access layer. The DAL is made up of the c# classes that access the tables and views in the database through stored procedures, it doesn't contain the database, the connection, the SQL or the table, these are all false statements. The database connection is normally held in the web.config, the SQL in the stored procedures and the tables on the database, normally on a separate server from the 3 tier code for security.
Dong YangPosted May 9, 2006, 4:55 AM
where can i find the project attached? thanks
FrancescoPosted Mar 21, 2006, 7:29 AM
where can I download the source? thanks