We divide large projects into different tiers to manage them more easily. Mostly the ASP.NET applications are divided into three tiers. In this article, we are going to see what is three-tier architecture in ASP.NET.
What is 3-tier Architecture:
The 3-tier architecture is a way of dividing a project into three parts for the sake of maintainability. Those three tiers are:
- User interface i.e. Presentation layer.
- Logic i.e. Business layer.
- Data layer
The topmost and most high-level layer in 3-tier architecture is the user interface. This layer represents what the user sees on his/her screen. The main purpose of this layer is to translate the tasks into the user-understandable form so that the user can understand and use the system. It is used to display data and to take input from users. An attractive and user-friendly interface helps in attracting more users. This layer should be designed properly so that users do not face difficulty in using the system.
This layer includes all the logic and operations of the system. It usually has different functions and C# classes that are used to perform different operations. This layer acts as an interface between the presentation layer and the data layer. It also validates any data that is sent to the user or taken as input from the user.
This layer interacts with the database and is used to perform different operations on the data stored in it. It contains different methods for insert, update, delete, create operations. It also contains stored procedures used to query data from the database. It connects the business layer to the data source so that the data could be displayed on the presentation layer or collected from the user.