In: Computer Science
C# Programming
In C# .NET you can build 3 different kinds of Presentation Layers. List them.
Three-layer architecture is made of Presentation, Business, and Data access layer. In this article, I will create three-layer architecture with the help of a simple ASP.NET application. You can understand the importance of these three layers with the help of complete article.
-Layers architecture
In the three layers architecture, as you can see, Presentation layer and business layer communicate with each other, and business layer (Controller) and data access layer (Model) communicate with each other.
Presentation Layer
The presentation layer is used to display the data to the users.
Your .html or .aspx Pages are presentation layer which shows data
to the users. Add one web application project to solution and give
the name Presentation layer to it. Add one web page as I did in the
below image.
Business Layer
This is the middle layer which communicates with Presentation and
data access Layers. Business layer sends a request to Data layer
for data and sends data to the presentation layer to display to the
end user. In this layer, we write business logic. Now, it is time
to create a business layer. Let us add one class library to create
a business layer and give the name BusinessLayer to it as I did in
the below Image.
Data Access Layer
Data access layer communicates with the database as well as the
presentation layer. Presentation layer sends a request to data
access layer and data access layer sends a request to the database
to get data and returns the data to presentation layer in the form
of the object, list, array etc. Now, it is time to create a data
access layer by adding one more class library and give name
“DataAccess” to it as I have added in the below image.