Monday, September 29, 2008

What is the difference between 3 Tier & 3 Layer Applications?

The terms tier and layer are frequently used interchangeably, but actually there is a difference between them:

Tiers indicate a physical separation of components, which may mean different assemblies such as DLL, EXE etc on the same server or multiple servers; but layers refers to a logical separation of components, such as having distinct namespaces and classes for the Database Access Layer (DAL), Business Logic Layer (BLL) and User Interface Layer (UIL).

Therefore, tier is about physical separation and units of deployment, and layers are about logical separation and units of design.

Source: https://www.nilebits.com/blog/2008/07/difference-between-three-tiers-three-layers-applications/

6 comments:

  1. Ok, Now the difference is 50% clear to me.I will create a sample web pplication & use this concept
    Thanks

    ReplyDelete
  2. Hi Mr\AMR
    very good, But we wanna have more details about tiers because alot of us care and work alot with layers, but tiers not all of us care about it..

    Yours,
    Hesham Elmasry

    ReplyDelete
  3. ok,
    could u plz provide a refrence for this concept coz it seems too silly to me and never worth posting :s
    sorry but i got so angry for wasting my time and urs too...

    ReplyDelete
  4. Thank you,
    your piece is quite informative even to someone like who doesn't know much about software.

    Kazeem from Nigeria.

    ReplyDelete
  5. hi, i hope you give your source for the concept,as i know it was never stated , but you are right there is logical separation of tiers and physical separation of tiers and they are diffrent, but can you tell me how to build optionally physically separated 3 tier apllication!!!!???
    Eng.Ahmad Zaher
    civilSoft Egypt

    ReplyDelete
  6. Ok guys, sometimes you need to physically separate different layers from each other's when you are working on a large scale project.

    Examples:
    -You are working on a large scale website which you may need to transform it into a windows application in the future or may need to create a windows application which will provide the same functionality as the website.
    So to make your project expandable you must use n-tiers not n-layers design

    -You have different projects which share the same business logic or data access layer.
    (I.e. Website, web service, windows application …etc.)
    So you CAN'T use n-layers because these layers won't be shared among your projects

    Now how to create N-Tiers?
    Simply Create 3 new projects of the type class library (DLL), call them:
    BusinessLogicLayer, DataAccessLayer and DataMappingLayer (if you are using DataMapping)
    Transfer the code you have created previously to the correspondent layer.

    If you don't know what's N-Tiers design, I suggest reading the book titled "Asp.net Website programming problem,design,solution" I believe it's a must have book and you can download the source code from here
    http://www.asp.net/downloads/starter-kits/the-beer-house/
    It's a complete website called the beer house and Microsoft suggests it as a starter kit.

    You can also read about n-tiers and DataAccessLayer on Asp.NET website
    http://www.asp.net/learn/data-access/

    Ahmed Fouad

    ReplyDelete