944,092 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 5611
  • Java RSS
Jul 24th, 2007
0

best way to code 3 tier application

Expand Post »
I'm wondering what thoughts people have on the best way to implement a 3 tier application.

I'm playing with the idea of multiple clients <---> server <----> database server <----> mysql database.

I'm not sure if the database server is a necessary step though.

My previous foray into java network progamming just used sockets, but I've read that RMI(?) is a better approach? What think ye? Does anyone know of a basic 3 tier code sample I can get my feet wet with?
Similar Threads
Reputation Points: 37
Solved Threads: 18
Junior Poster
agrothe is offline Offline
151 posts
since Jun 2006
Jul 24th, 2007
0

Re: best way to code 3 tier application

RMI is the way to go. Definitely.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jul 24th, 2007
0

Re: best way to code 3 tier application

J2EE is also designed for such things, but it can be a pretty heavy architecture for a simple client-server app.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Jul 24th, 2007
0

Re: best way to code 3 tier application

why reinvent the wheel when there are perfectly good solutions like Hibernate and Spring already out there?
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 25th, 2007
0

Re: best way to code 3 tier application

Thanks for the suggestions! Isn't Hibernate an implementation of RMI?? anyway....

Hypothetically speaking, if an application need to scale from 50 to 500,000 users(disregarding hardware issues) would all three tiers really be necessary? Could we just go with:

many clients <----> Server <----> Database ???

Although I guess the 3rd Tier allows for better control of say, connecting to different types of databases though...

And although yes, Hibernate/RMI seams like the way to go, I think all would agree setting up a simple client server from scratch or playing with a code sample is probably better starting out to learn the bare bones first. At least I find that jumping into something more complex without first seeing the different parts in action just complicates the matter.
Reputation Points: 37
Solved Threads: 18
Junior Poster
agrothe is offline Offline
151 posts
since Jun 2006
Jul 25th, 2007
0

Re: best way to code 3 tier application

No, Hibernate abstracts away all that nitty gritty JDBC code to access the database.
http://www.hibernate.org

You shouldn't care whether you're talking through RMI or whatever, use an existing system to worry about that.

Spring makes for a lot of very nice capabilities. http://www.springframework.org/
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Jul 26th, 2007
0

Re: best way to code 3 tier application

Depending on your application one of the 2 approaches can be chosen.. If you have enough complexity in DB parts OR more than one servers connecting to DB layer, you might want to have database server separately..
In anycase as Ezzarel pointed out J2EE is designed EXACTLY for this purpose.. See this architecture diagram.. it's not mandatory to have 2 physically different machines for J2EE and DB server, both can be on one machine..
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
Jul 26th, 2007
0

Re: best way to code 3 tier application

i suggest:
hibernate for data layer
spring for MVC
freemarker view layer
dwr for ajax
Reputation Points: 25
Solved Threads: 11
Junior Poster
tonakai is offline Offline
121 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Jtree with JCheckBox
Next Thread in Java Forum Timeline: jasperReport and iReport for Linux





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC