views:

46

answers:

4

Recently i got this question in my interview..

He had asked me about N tier ,I was telling him about 3 tier applications Suddenly he asked me Can i have 5 tiers :) I told him may be but i never used that..

IV: Ok now tell me what can be the 5 tiers ME: BLa bla

After the interview i asked him for the answer and he gave me a example like below

Web or client layer -> delegate(pattern)Ejb layer(business)->value objects(pattern)-Implemenatation of dao layer-then ur db

He added one more point when your application talks with another application then urs will be N tier application

Is it so friends?

+4  A: 

I think he confused tiers with layers.

In an architecture, tiers are the coarsest building blocks, seperating concerns like presentation, business logic and persistence, sometimes even in a physical manner. However, a design can introduce additional layers for reasons like reusability, but that doesn't affect the number of tiers the architecture is made of.

torbengee
+1 Have the same feeling. Layers are logical. Tiers are physical.
ewernli
You can distribute layers across several tiers.
Pascal Thivent
A: 

Then what can be the 5 tiers?

karthick prabhu
+1  A: 

You can have more than 3 physical tiers, e.g. if you have (1) presentation accessing (2) business logic using (3) web services to wrap (3) legay application which uses a (4) database. But I think like torbengee that it was rather a confusion between logical layer and physical tiers.

ewernli
+2  A: 

Here is an example (I'm not saying follow it, only hardware vendors and application servers vendors like to sell this monster):

  1. Client Tier: browser
  2. Presentation Tier: Servlet/JSP
  3. Service Tier: Session Beans
  4. Domain Tier: Entity Beans (writing this makes my eyes bleed).
  5. EIS Tier: database

Now, to answer your question, a design pattern is certainly not a tier in itself. But a tier can be made of components implementing a pattern (e.g. the Session Beans of the Service Tier implement the Facade pattern).

Pascal Thivent
thanks pascal for the explanation
gkpstar