tags:

views:

38

answers:

1

Its all about N-Tier architecture. In my web application I had an requirement to use JSON in a page.So I introduced one tier called as DTO. So My question is is it right or wrong. what are the similar changes that would introduce more tiers to an application

A: 

It's not changes in an application that defines tiers per se. It's the code architecture you develop that defines tiers.

With traditional N-Tier web application, you have:

  • Presentation/UI Layer - web page markup, styling, etc.
  • Business Logic Layer(s) (BLL) - 1 or more middle tiers which contain your application/business rules and actions
  • Data Access Layer (DAL) - tier which deals with persistent storage, such as the use of the Entity framework, LINQ, etc.
  • Persistence Layer - the actual data layer, generally a database.

The idea with N-Tier development is that each layer plays a key role. It relies on the underlying tiers' functionality and knows little to ideally nothing of the tier(s) above it. Your DAL for example, may have methods called SaveUser, GetUser, etc. The Business layer knows about these methods, but doesn't know about their implementation or even care about their implementation. All it knows is that when it needs to save or get a user, it calls those methods.

The advantage of this is that you can change your database type from MySQL to MSSQL for example, and only have to update your DAL. The layers above don't know or care about this.

Based on how open ended your question is, you may want to consult more background reading on the subject, such as:

http://en.wikipedia.org/wiki/Multitier_architecture

KP