• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2-tier, 3-tier?

 
Liang Anmian
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

After reading so many posts from this forum, I realized that many people mentioned about 2-tier and 3-tier design. I will like to know the difference. I'm not even sure how many tiers my design has.

Thanks.
 
joe lin
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Liang ,
I think you should read some materials about MVC.
the MVC pattern will tell you how to built a three-tiers application.
regards!
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simply said,

2-tier:
- Data Access layer
- Fat Client (GUI + Business Logic)

3 (or n)-tier:
- Data Access layer
- Business layer
- Thin client

I would say that MVC is a concept independent of the number of tiers.
 
Frans Janssen
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also not sure if the number of tiers is connected with thin or fat client. I had 3-tiers (at least I'd like to think I did), but I had my business tier client-side.

So I feel that I had a combination of 3-tier and fat client design.

Frans.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11866
194
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Liang,

Got a day or two to spare

Take a look at "Should lock methods be callable by the client", which delves into what a thin client (also misnamed as 3-tier) and thick client (misnamed as 2-tier) is, and arguments for why some people believe one option might be required along with counter arguments.

If you get tired and can't read to the end: the end result is that either choice seems to be acceptable at present.

Regards, Andrew
 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I started to program the project, I read
lots of articles of javaranch but was hard to decide
which way to go. After reading the following article,
I decided to go with 3 tier. This article is a classic argument
between 2 and 3 teir.
http://www.coderanch.com/t/184224/java-developer-SCJD/certification/Should-lock-methods-callable-client

If you don't have time to read through the whole article,
the conclusion is 2 or 3 tier is OK to sun. If you don't want to handle
connection loose and don't want to send lock cookie to your client,
you can go with 3 tier, like what I did.
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Regardless of your choice on where to divide the tiers, all solutions to this project are TWO TIER. This is because all you have is a Client and a Server. The choice of implementing only the business actions of Find and Book is still two tier and is still a rich client, maybe slightly poorer than the other choice, but not really thin.

To be a truly thin the client must know NOTHING about the business or data aspects of the system and be only concerned with "presentation", the View in MVC, a browser would be a good choice.

I started out with the "thinner" client, only exposing the Find and Book methods to the client. I switched sides, because I couldn't really justify that choice if required to. The instructions clearly direct you to use a "traditional client-server system" and the server is described as "a data management system". These two requirements are in the section entitled "Overall Architecture". I have never seen a data management system that knew anything about anyone's business logic.

If you wish to make things easier for yourself by ignoring the architectural requirements, you should plan to document your choice very convincingly. There have been a few people who have passed using the "thin" solution, I haven't seen thier choices document, but I suspect it was well written.

If I were marking this assignment, I'd fail any submission that did not provide a "data management system" and a "traditional client-server" since its explicitly required.
 
Matt Sheehan.
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by peter wooster:
There have been a few people who have passed using the "thin" solution, I haven't seen thier choices document, but I suspect it was well written.


I really doubt this is part of the grading criteria. I used the "thin" solution and easily passed with this brief explanation in my choices doc:
The locking was hidden from the clients because it makes the application simpler and thus easier to understand for a junior programmer.


Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic