THREE TIER ARCHITECTURE IN ASP.NET
Three tier architecture means dividing our project into three separate layers that is,
• Presentation Layer (UI – User Interface and related presentation code. )
• Business Logic Layer (maintains business rules and logic )
• Data Access Layer (manages the physical storage and retrieval of data )
Presentation Layer/ Application layer
It is a user interface layer where we can design our web pages or windows pages. It is basically .aspx page or html page where we can make design with controls.
Business Logic Layer/Business Access Layer
Business layer is the intermediate or middle layer that communicate presentation layer and Data access layer. This layer is used to validate the input condition and correct the date before calling method from the data layer.
Data Access Layer
Data Access Layer is used to make connection to database server. In data access layer we can write database query, stored procedure for insert, update, delete, select operation on the database. This layer communicates with Business logic layer only.
What are the working process of 3 Layers:-
- When any user post data from your presentation layer
- Then this data first goes to Business Access Layer .
- After that validation and calculation are held on this layer .
- After that this data pass data to the Data Access Layer .
- After that Data Access Layer fetch the required data or insert the data into database.
- After that Data Access Layer pass the required data to the Business Access Layer.
- After that Business Access Layer send the required data to the Presentation Layer.
- After that Presentation Layer is responsible to display the required data to the users’ computers or mobiles or Windows.
Why do we use 3 Tier Architecture:-
- To increase the security .
- To easily maintain the application.
- To Reduce the server overload.
- To reduce the loading time of application.
Advantages:-
- Each layer always uses separate codes,so it is easy to change the codes.
- It is helpful to easily maintain and understand large projects.
- We can change any layer codes without affecting other two layers.
- It is a more consistent application.
Disadvantages:-
- It takes more time to build.
- Many peoples face problems because they haven’t good knowledge of oops concepts and other c# programming such as class, object, property etc.
- Tier Architecture is more complex to build.