views:

103

answers:

3

I recently came to know that, different Information Technology are also based on N-Tier Architecture.

For example, a Web Technology is usually 3-Tier Architecture: The user, The Web Server and The Database Server. But we also develop various applications in N-tier. What are the difference between these two and how are they related to each other.

+1  A: 

The "n" in n-tier basically means "a number you choose", so you could called it multiple-tier architecture. Normally, this manifests itself in three tiers. Display, Logic and Data.

This could be implemented in many different ways, as you mention - you've seen it in action where the web page has the display function, a web service has the logic function and the database satisfies the data tier.

N-Tier is an architecture, so it can be applied to any language / technology. It isn't quite a design pattern, but the principle behind it is the separation of concerns between data, logic and presentation. The difference between N-Tier architecture and a design pattern is that with N-Tier, it is describing a physical hardware separation as well as code-unit separation. A design pattern would be concerned about the code design, but not the server design.

Sohnee
A: 

"N-tier" refers to some number of distinct tiers (or partitions) that your application or architecture has been divided into. Using n-tier applications, modifications or additions to the architecture become simpler, as the entire architecture would not need to be re-written if properly divided into tiers.

Take a look at this example tier architecture.

Sev
A: 

It places constraints on the developer to limit the responsibility of the code to specific concerns in each of the layers.

i.e. :

View layer deals with making things effectively presented and validate the input and prepare it for use inside the application

Service layer will capture the "Business Rules" i.e. the logic in the reltions and transformations of the objects.

Persistence Layer will limit itself to getting data from and to long term storage, usually a database.

By limiting the responsibilities code in each layer becomes clearer and more focused and it is easier to reason about (at the expense of additional plumbing).

Peter Tillemans