Saturday, 30 August 2014

3 Tire Architecture.

3-Tier architecture is a very well know buzz word in the world of software development whether it web based or desktop based. In this article I am going to show how to design a web application based on 3-tier architecture.
Introduction 
3-Tier architecture generally contains UI or Presentation Layer, Business Access Layer (BAL) or Business Logic Layer and Data Access Layer (DAL). 

Presentation Layer (UI) 
Presentation layer cotains pages like .aspx or windows form where data is presented to the user or input is taken from the user. 

Business Access Layer (BAL) or Business Logic Layer 
BAL contains business logic, validations or calculations related with the data, if needed. I will call it Business Access Layer in my demo. 

Data Access Layer (DAL) 
DAL contains methods that helps business layer to connect the data and perform required action, might be returning data or manipulating data (insert, update, delete etc). For this demo application, I have taken a very simple example. I am assuming that I have to play with record of persons (FirstName, LastName, Age) and I will refer only these data through out this article.
 
What is Tier and Layer ?
Here I Will explain what is Tire  and Layer we need to clarify the difference between two terms in N-Tier architecture  Tier and Layer. Tier usually means the physical deployment computer. Usually an individual running server is one tier. Several servers may also be counted as one tier, such as server fail-over clustering. By contrast, layer usually means logic software component group mainly by functionality  layer is used for software development purpose. Layer software implementation has many advantages and is a good way to achieve N-Tier architecture. Layer and tier may or may not exactly match each other. Each layer may run in an individual tier. However, multiple layers may also be able to run in one tier. 

Tire:
It indicates a physical separation of components, which may mean different assemblies such as DLL, EXE, etc. 
Layer:
It indicates a physical separation of components, which may mean different assemblies such as DLL, EXE, etc. on the same server or multiple servers.

By using 3-Tier architecture in your project you can achive 

1. Seperation - the functionality is seperated from the data access and presentation so that it is more maintainable 
2. Independence - layers are established so that if one is modified (to some extent) it will not affect other layers. 
3. Reusability - As the layers are seperated, it can exist as a module that can be reused by other application by referencing it. 

Hope this article helped you understanding 3-Tier architecture and desiging it.

0 comments::

Post a Comment

Copyright © DotNet-Ashok