28 April 2014

Real-Time 3-Tier architecture Application Example using ASP.NET

In 3-Tier programming architecture, the application development is broken into three main parts.
These are:
1.Application/Presentation layer
2.Business Acess Layer(BAL) and
3.Data Access Layer(DAL).
These separations ensure independent development of those layers such that a change in one does not affect the other layers. For instance a change in the logic of the DAL layer does not affect the the BAL nor the presentation layer. It also makes testing easier in that a whole layer can be replaced with a stub object.

For example instead of testing the whole application with an actual connection to database, the DAL can be replaced with a stub DAL for testing purposes. The DAL deals with actual database operations. These operations are inserting, updating, deleting and viewing. The BAL deals with the business logic for a particular operation. The PL has the user controls for interacting with the application.

3-Tier programming architecture also enables re-use of code and provides a better way for multiple developers to work on the same project simultaneously.
1.Start a new website project
2.Design you page as shown below,
                           

3.Add sub-folders and class objects within the App_code folder as shown below,
                       
 /*
    1.First Add sub-folders and class objects within the App_code folder and then
     Create Database(RegDB.mdf) and create a table (Registration) with field names as shown below(regBEL.cs file).