Wednesday, May 16, 2012

n-Tier Folder Structure


n-Tier Architecture in ASP.NET n-Tier Architecture in ASP.NET


Architecture is an important feature and the very first step in the development of an application. n-Tier the term is used for multiple tier or multiple layers. n-Tier Architecture splits the solution process into different projects based on the business requirements. The main advantage of using n-Tier is that the complexity associated with the business and the process is reduced and it is easy to work with. The elements of performance, scalability and future development issues need to be considered when deciding on the architecture of the application depending on the priorities required.

The n-Tier application has three tiers or layers, they are called the presentation tier, the business tier and the data tier. Each layer interacts with the layer directly below, and has specific function to perform. Presentation Layer is responsible for displaying user interface to either programmer or end user. Programmer uses this layer for designing purpose and to get the data back and forth. In ASP.NET it includes ASPX pages, user controls, server controls and sometimes security related classes and objects.

The Business layer works as a mediator to transfer the data from presentation layer. In the three tier architecture the data access layer is not made to interact with the presentation layer. The architecture in ASP.NET includes using SqlClient or OleDb objects to retrieve, update and delete data from SQL Server or Access databases and passing the data retrieved to the presentation layer in a DataReader or DataSet object, or a custom collection object. The Data layer gets the data from the business layer and sends it to the database or vice versa. This layer is further divided into two sub layers Business Logic Layer (BLL) and Data Access Layer (DAL). DAL is responsible for accessing data and forwarding it to BLL. In ASP.NET it uses SqlClient or OleDb to retrieve the data and send it to BLL in the form of a DataSet or DataReader. BLL (Business Logic Layer) is responsible for preparing or processing the data retrieved and sends it to the presentation layer.

The Data layer gets the data from the business layer and sends it to the database or gets the data from the database and sends it to the business layer. In ASP .NET it is an SQL Server or Access database. It can also be Oracle, mySQL or even XML.
In an ASP.NET n-tiered architecture web pages do not make direct calls to the database. A given layer only communicates with its neighboring layers. ASP.NET Web pages should reference custom objects defined in the business object layer. These objects provide database information in a class structure.

MVC Folder Structure




Application information
Properties
References
Application folders
                                                                        App_Data Folder
                                                                        Content Folder
                                                                        Controllers Folder
                                                                         Models Folder
                                                                        Scripts Folder
                                                                         Views Folder
Configuration files
Global.asax
packages.config
Web.config

MVC Tutorials

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...