Click here to Skip to main content
15,883,990 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am developing a web application but first i wants to know which architecture is best 3 tier or two tier
Posted
Updated 16-Sep-12 20:55pm
v2
Comments
Sergey Alexandrovich Kryukov 17-Sep-12 2:38am    
The answer is: one has three tiers, another -- two tiers. Can't you see that such questions are incorrect?
What exactly do you need to know or have concerns about?
--SA
AmitGajjar 17-Sep-12 3:08am    
Vithal, Please respect all seniors here. if SA says something there must be some reason. it's like pain when someone downvote us. But in long run it will help us to improve our skills(softskills). See my solution for more information on your question.
[no name] 17-Sep-12 3:13am    
Sorry @amitgajjar Sir I will remove my comments but i am asking proper question
AmitGajjar 17-Sep-12 3:15am    
Dont be sorry. we all are working here as friend. people here are contributing when they have extra time. So we should respect their time and we should be down to earth.
Sergey Alexandrovich Kryukov 17-Sep-12 19:43pm    
Those are golden words, Amit; I totally agree and support this view.

I'm not sure you had to protect me against the negative comment by Vithal, especially if you use such shaky arguments as who is "senior", etc. Thank you very much for your support, anyway. We all should respect each other and our rightfulness or failure should only be measured by truth, nothing else. I saw his comment; he complains that I evaluated his posts negatively and maintains that his question is correct.

Every concern deserves some explanation. I don't remember all my comments, but the chances are, that I pointed out incorrectness of questions, so OP might think about: who is really responsible for incorrectness of the questions. So, I can give my explanation about the present question. It's two-fold.

The title has the form "what's the difference between {0} and {1}"? It cannot be a correct question. I answered: "one has three tiers, another -- two tiers". It means that nearly anything can be called a "difference". This is just a figure of human speech, not a strict concept. As I usually ask: can you tell the difference between apple and Apple?

Now, similar thing goes about what is "best". Logically, to answer this question, one would need a definition of "better than". For architectures, it is really absolutely not defined. Let's look at this in the following way: if, say, some N-tier architecture for some fixed N existed as was "the best", all n-tier architectures for n!=N would never be used. Nevertheless, different number of tires are used in different systems. This is because there is nothing special about any particular number of tiers and their roles: they are devised to solve some practically important situations. So, n-tier architectures does not have any absolute value; their value is totally related to some sets of application problems they may or may not be well applicable to, no more. So, asking "what's the best" makes no sense at all and cannot be answered.

For an enquirer, it's way to easy to play offended card and pretend the criticizing person is responsible for some trouble. But in this case, who is the looser? :-)
For everyone, it's much more fruitful to listen to criticism and try to improve one's work by actually using this criticism. Of course, anyone has a right to ask for proper arguments. I personally would gladly answer to such concerns.

Thank you.
--SA

Hi,

As of now you will not see much difference. Creating multiple layers is like seprating your code for load balancing or making your code maintainable.

If you are running small project with single entry form, you may find 3Tier architecture more complicated but when you go for the complicated solution with validation/Security you found it very helpful.

Sometimes people used to call NTier architecture, it means they divide thier code in multiple tire to perform multiple task.

So Using Business layer in between UserInterface and DataAccess is optional depending upon how you are maintaining your code.

Hope you got some idea.
 
Share this answer
 
Comments
[no name] 17-Sep-12 3:14am    
Thanks a lot sir

n Sorry @amitgajjar Sir I will remove my comments but i am asking proper question
AmitGajjar 17-Sep-12 3:16am    
Polite people always win the world in long run.
[no name] 17-Sep-12 3:25am    
thank u sir next time i will take care about my comments an i am new on code project so i will learn a lot in future
AmitGajjar 17-Sep-12 3:50am    
Thats for sure.
__TR__ 17-Sep-12 5:50am    
My 5! Nicely explained.
Hi there,

I am sorry to disappoint you but I believe what S.A.Kryukov is trying to say is correct.

The main difference between the 2-tier and 3-tier architectures is that, the the latter has a clear extraction of it's business logic into an intermediate layer. This way, the dependency to UI is minimized.

But you cannot say one is better than the other (as per your question, 'what is the best') due to the reason that, it all depends on the complexity of the application you want to develop.

I'll try to explain it with an example. Let's imagine, you are developing a complete web based solution for a certain company. We can consider this system to be somewhat large, complex and is subject to changes/updates frequently. Now this is where the 3-tier architecture comes handy. You can change things easily. But you should remember that, in this scenario based on the complexity, you might go for 4-tier, 5-tier (n-tier architecture). These tiers might be physical or logical as well.
But imagine you are developing a website for an assignment. It's awesome to do that in a 3-tier or n-tier architecture but all you are doing is introducing a unnecessary level of complexity.

These design guidelines/patterns exist for a reason. I.e. to help you create robust applications/websites/components. Not to create the best applications. You have to decide what design guidelines/patterns to use based on your requirement, not the other way around. You have to apply these guidelines to get rid of an existing bottleneck or an applicable bottleneck foreseen. So there is no best architecture; I hope I made sense to you.

Hope this helps, regards
 
Share this answer
 
Comments
[no name] 17-Sep-12 3:23am    
Thank u CodeHawkz sir next time i will take care about my comments an i am new on code project so i will learn a lot in future
CodeHawkz 17-Sep-12 5:41am    
:) Glad I could help
__TR__ 17-Sep-12 5:51am    
+5
Sergey Alexandrovich Kryukov 17-Sep-12 19:47pm    
My 5. Please also see my comment in the comments to the question.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900