SIGN UP MEMBER LOGIN:    
ARTICLE

Importance of Data Access Layer

Posted by Krishnan LN Articles | ADO.NET in C# January 19, 2006
This article is written to see the importance of having a separate Data Access layer.
Reader Level:

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.

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 ofcourse.

Database Layer

The database layer takes care of persistency. 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 the 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#.

Login to add your contents and source code to this article
share this article :
post comment
 

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

Posted by Shashidhar K Feb 20, 2009

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.

Posted by roushan kumar Feb 27, 2008

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.

Posted by Paul Scully Nov 30, 2006

where can i find the project attached?

thanks

Posted by Dong Yang May 09, 2006

where can I download the source?

thanks

Posted by Francesco Mar 21, 2006
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Gauge for SharePoint
Become a Sponsor