aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes What is 3 tiers/2 tiers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "What is 3 tiers/2 tiers?" Watch "What is 3 tiers/2 tiers?" New topic
Author

What is 3 tiers/2 tiers?

Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi,
I read many posts about 3 tier/2 tier? I am great confused by the terms . Can anyone clear me? Thank YOu!
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11481
    
  94

Hi Damu,
Standard definitions:
  • Single tier is a monolithic application. GUI, business logic, and database are all in one application.
  • Two tier: two applications, typically client & server.
  • Three tier: three applications, typically client, business server, and database server


  • Several people here have been talking about having business methods on the server (such as the "book()" method) which the client would call. This would work well in a three tier solution where the client has very little logic (also called a "thin" client), there is a middle tier which has the business logic, and a back end database. Even though there are not three distinct applications in our assignments, some here have called this a "3 tier solution" or a "thin client solution".
    Others have been talking about having the client encapsulate the business logic - so the client itself will call each of the methods which are exposed from the database. This is a "2 tier solution", or a "fat client solution".
    You can read all about the arguments for and against thin/fat clients in this never ending thread. You can even join in as long as you are willing to argue against Phil
    Regards, Andrew
    [ October 15, 2003: Message edited by: Andrew Monkhouse ]
    [ October 15, 2003: Message edited by: Andrew Monkhouse ]

    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    Bigwood Liu
    Ranch Hand

    Joined: Feb 26, 2003
    Posts: 240
    Hey Andrew, thank you very much!
    I plan to construct a mvc GUI at client side, and a ClientModel to include the business methods in it. I want to design the ClientModel as a Data/RemoteData wraper. The controller in GUI will call the methods in ClientModel which will call the methods at db package(local mode) or through net. Is this kind of structure reasonable? Thank you for comment!
    Regards,
    Damu
    Joe J. Wang
    Ranch Hand

    Joined: Feb 26, 2003
    Posts: 67
    Hi Damu,
    So you are going to join the 3-tier camp, right?
    The thread Andew refer to you is really a good one to read about the topic 2/3 tier design.
    Best,
    Joe


    SCJP, SCJD, SCWCD, SCEA I.
    Jim Yingst
    Wanderer
    Sheriff

    Joined: Jan 30, 2000
    Posts: 18671
    So you are going to join the 3-tier camp, right?
    Not according to his post so far. (Did you read it?) Instead, it sounds like he's planning to follow the actual requirements he's been given.


    "I'm not back." - Bill Harding, Twister
    Vlad Rabkin
    Ranch Hand

    Joined: Jul 07, 2003
    Posts: 555
    Hi,
    I agree with Jim,
    It looks like 2 -tier, because his ClientModel is on the client.
    Best,
    Vlad
    Bigwood Liu
    Ranch Hand

    Joined: Feb 26, 2003
    Posts: 240
    Hi,
    My ClientModel is at client side, it includes all business methods. Thus as Jim imply, it is two tiers. But if I put the ClientModel at server side, do you call it three tiers? The stucture is almost the same!
    Regards, Damu
    Jim Yingst
    Wanderer
    Sheriff

    Joined: Jan 30, 2000
    Posts: 18671
    In fact I'd prefer to call the two designs fat client (2-tiers) and thin client (3-tiers), but those have not caught on here. Saying 3-tier would make more sense if the business layer could be on a different machine entirely, IMO. Oh well...
    Joe J. Wang
    Ranch Hand

    Joined: Feb 26, 2003
    Posts: 67
    Hey Damu,
    You do have the time to re-think about it and change to 3-tier design.
    Kidding.
    Yeah, Jim is right, fat/thin client will be more accurate for those two designs.
    Regards,
    Joe
    Bigwood Liu
    Ranch Hand

    Joined: Feb 26, 2003
    Posts: 240
    Hi I agree with all of you! It is better to call it thin/fat client.
    I prefer thin client now. When I try to fill the content of table, I have to get the information of fields , which isn't provided by the DBAccess interface. My ClientModel will do all the business work at client side, there should be only one db operator in ClientModel, this operator has diffrent reference(localOperator/remoteOperator) when the mode is diffrent. So the operator should have a interface diffrent from DBAccess, it should has getSchema() and close() methods. I include these two methods and book(),search() in a interface at server side. Thus I have a fat server and a not very thin client.

    Best,
    Damu
    [ October 18, 2003: Message edited by: damu liu ]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: What is 3 tiers/2 tiers?