N-Layered != N-Tiered: Know the Difference!

Technorati Tags: ,

I hear a LOT of developers refer to what are essentially N-Layers as “N-Tiers”.  This kind of bugs me a little when I see or hear it from developers. 

First of all, they are not even close the same thing, and it’s important as a developer to get this straight so that you are using the terminology properly.  The difference is simple but very important when you’re talking about your applications.  They should not be loose terms and intermingled as about probably 90% of the developers out there that I’ve worked with seem to do.

Take a look at a good article I’d like to surface from David Hyden about N-Layers and N-Tiers.  Make sure you know what you’re talking about at work or in interviews both for an interviewer doing the interview or potential interviewee.  It’s important especially in architecture that you know the difference here if you are going to be talking about them to your colleagues, subordinates, or potential employers.

Web Applications: N-Tier vs. N-Layer

code Layers:  This is how you are structuring/organizing your actual code and how you are forcing separation of concerns…design patterns

server Tiers: Is your physical separation/location of your code & across process boundaries (physical servers which are running your application’s processes, etc.).  It has nothing to do with naming your code layers

With that said, when naming your layers in .NET solution you should not use the term “Tiers” in the name.  That’s not a Tier.  It’s a Layer of Code.  Use the proper term “Layer”.  Use a proper naming pattern with the proper term.

So for example in a typical .NET solution I see this an awful lot and it’s not right (.sln):

Incorrect

AppName.DataTier.csproj

AppName.BusinessTier.csproj

AppName.Web.csproj

AppName.ServiceTier.csproj

Correct

AppName.DataLayer.csproj

AppName.BusinessLayer.csproj

AppName.Web.csproj

AppName.ServiceLayer.csproj


    kick it on DotNetKicks.com

Print | posted on Saturday, October 11, 2008 12:04 AM

Comments on this post

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Get over it. It isn't important.

(Grammar and spelling is though).
Left by Jill Masters on Oct 11, 2008 4:39 AM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
In find a couple things amazing about your reply

1) It's not even constructive
2) It shows a very cocky and defiant attitude in general toward process in general and learning
3) You're issue about "it doesn't matter" is completely incorrect. Some people do not even know the term "Layer". They just loosely use terms and use "Tier". It's important to know the difference if you're going to be throwing those terms around and it's just good knowledge if you ever go into architecture period. Especially when you are naming projects or even your name spaces in your code it matters.

Terminology matters, attitudes matter...especially when you use it incorrect are are unaware of differences. That's the whole point of learning code and learning process.
Left by Dave Schinkel on Oct 11, 2008 10:12 AM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Tier != physical server. An app with a thick client, an application server and a database server all running on the same machine is still a 3-tier architecture.
Left by Dave on Oct 12, 2008 11:08 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
I am usually not a stickler with jargon and being 100% completely right. However, I completely agree with your article.

I have used this language difference before. To me its the same as QA using same words for defect or bug (they happen in totally different testing cycles).

I think this differentiation is very important. With one sentance you can imply a lot if the jargon is being used correctly. If someone says to you "We are offering a 3-tier enterprise solution"...already you can infer this requires 3 seperate OS environments.

I would disagree though that now virtualization is popular I don't think that tier = physical; it could also mean a virtual appliance or virtual OS.
Left by Bart Czernicki on Oct 12, 2008 11:23 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
1. It was not supposed to be constructive. It was my opinion. It is also the case that these names have changed meaning over time so some people are simply using an older variation on the name. It is not constructive to post a rant about naming and tell others they are wrong just because they don't use the current naming convention.

2. Et tu.

3. I disagree. I am glad that you don't have things more important to worry about.
Left by Jill Masters on Oct 13, 2008 10:58 AM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Of course, but presumably you have comments switched on so that people can disagree? Or do you only want people to tell you how great your opinions are?
Left by Jill Masters on Oct 13, 2008 12:11 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
>>"It was my opinion"

Yes, and this is my blog...my opinion.

>>>Of course, but presumably you have comments switched on so that people can disagree? Or do you only want people to tell you how great your opinions are?

Yes, and that's why ALL of your comments show up. I have not filtered anything.
Left by Dave Schinkel on Oct 13, 2008 12:21 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Yet you don't like that I don't agree.
Left by Jill Masters on Oct 13, 2008 2:04 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
@Jill,

Not sure what ur deal is, but man if you do not have something positive to say, then leave.
Left by Derik Whittaker on Oct 13, 2008 2:24 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
I am not a man.
Left by Jill Masters on Oct 13, 2008 3:34 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
I couldn't agree more. I wrote a post on this recently, giving my thoughts why the confusion is a problem. It's not a jargon/preference issue, both concepts are loaded with implication, and the sooner we're all speaking about the same thing when we discuss them, the better.

And it's not just your opinion, it's the truth!
Left by Ben Hart on Oct 14, 2008 10:40 AM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
@Jill,

You are clearly not a man (got that from the name). But you are clearly also a pain in the ass. If your tone in the comments are any indication of your personality you must be a joy to work with.

Left by Derik Whittaker on Oct 14, 2008 2:59 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Haha.

I reply in this manner because this type of blog post makes me angry. People ranting about the latest terminology and how other people are idiots (I paraphrase) because they use terminology that is simply a little older.

Anyone who developed through the DNA period and didn't change terminology is, in this guys opinion, wrong to use their own terms. Personally, as you now know, I find this unimportant and actually find the OP's position to be quite odd when there are much more important things to worry about.
Left by Jill Masters on Oct 15, 2008 2:51 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Jill,

I'm sorry but this is not the "latest technology". The terms Layer and Tier are not new.

Now, you are taking this way too seriously. There are foundations that OOP is built upon, layers and tiers being one and design patterns being another and so on and so fourth.

I'm not a stickler for knowing the hippest thing on the market. I've worked with cocky asses like that and I'm not like that. However, there are some terms that are used way too losely such as "lightweight" that really should be explained how.

Anyway, you need to chill. I know what kind of developers you are talking about...those cocky prick types. I'm not like that...and I hate working with developers who act like their shit does not stink.

This is an OPINION. If you find attitude in it, tough luck but it's part of an opinion sometimes.  I do not think my post was "that bad"..but you are making it out to be the worst thing in the world. But it's a very solid case and concern.

I welcome your comments, but please argue them in a constructive fashion negative or not.  I could give a shit less if you don't agree, and hey, that's what opinions are for right?   That also opens the avenue for CONSTRUCTIVE discussion.  But what you just brought forth is mumblings and a bad attitude to begin with in the way you even posted initially saying  "get over it".  That's a real great attitude, why not elaborate to begin with on your argument and sound at least a little more professional about it initially.

>>>I find this unimportant and actually find the OP's position to be quite odd when there are much more important things to worry about

If you find it unimportant, that's your opinion an that's fine.  But this is my blog and if I feel it's a legitimate topic to talk about, and I will post whatever I damn well please because that's what blogs are for.  Sure, there are many things that are important and this is one.  Maybe I have not gotten to what "you" think is important yet.  So enlighten us and chill.
Left by Dave Schinkel on Oct 15, 2008 6:04 PM

# re: N-Layered != N-Tiered: Know the Difference!

Requesting Gravatar...
Ouch ;-)
Left by Bob Saggett on Oct 16, 2008 7:00 AM

Your comment:

 (will show your gravatar)
 
Please add 4 and 1 and type the answer here: