• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2-tier, 3-tier?

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
https://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.
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Their achilles heel is the noogie! Give them noogies tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic