Implement N tier architecture using web service in ASP.Net

Last Reply on Dec 20, 2013 10:40 AM By Pradip

Posted on Dec 20, 2013 10:25 AM

Please share me demo site using N Tier with Webservice.

Thanks

You are viewing reply posted by: Pradip on Dec 20, 2013 10:40 AM.
Posted on Dec 20, 2013 10:40 AM

If they are on separate machines then the common scenario using Microsoft technologies would be:

  1. User Interface (UI) implemented by ASP.NET
  2. Business Layer (BLL) implemented by C# or VB .NET as bunch of DLLs
  3. Data Access Layer (DAL) as a relational database i.e. a SQL database with it's tables, stored procedures... plus classes (Some DLLs) to access database. Best practice is using ORMs i.e.Entity Framework to handle Data Access Layer and Data Layer.

Your layers in common scenario will communicate to each other this way:

  • Your UI will communicate to BLL commonly using Web Services.
  • Your BLL will communicate to DAL commonly using Web Services.
  • Your DAL will communicate to Database commonly using TCP/IP.

Although n-Tier design is the best practice, it doesn't mean each layer should be hosted on different machine (consider it more a logical separation than physical). For example if you keep all 3 layers on the same machine and just host your database on a different server then you don't need implementing web-services for BLL and DAL which results in less complexity and time-to-implement plus other benefits i.e. higher communication speed and security.