best way to code 3 tier application

Reply

Join Date: Jun 2006
Posts: 119
Reputation: agrothe is an unknown quantity at this point 
Solved Threads: 14
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster

best way to code 3 tier application

 
0
  #1
Jul 24th, 2007
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?
------------------------------------------------------------
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 376
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: best way to code 3 tier application

 
0
  #2
Jul 24th, 2007
RMI is the way to go. Definitely.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,363
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 500
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: best way to code 3 tier application

 
0
  #3
Jul 24th, 2007
J2EE is also designed for such things, but it can be a pretty heavy architecture for a simple client-server app.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: best way to code 3 tier application

 
0
  #4
Jul 24th, 2007
why reinvent the wheel when there are perfectly good solutions like Hibernate and Spring already out there?
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 119
Reputation: agrothe is an unknown quantity at this point 
Solved Threads: 14
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster

Re: best way to code 3 tier application

 
0
  #5
Jul 25th, 2007
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.
------------------------------------------------------------
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,145
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: best way to code 3 tier application

 
0
  #6
Jul 25th, 2007
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/
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 539
Reputation: thekashyap will become famous soon enough thekashyap will become famous soon enough 
Solved Threads: 50
thekashyap's Avatar
thekashyap thekashyap is offline Offline
Posting Pro

Re: best way to code 3 tier application

 
0
  #7
Jul 26th, 2007
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..
Are you Agile.. ?
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 121
Reputation: tonakai is an unknown quantity at this point 
Solved Threads: 11
tonakai's Avatar
tonakai tonakai is offline Offline
Junior Poster

Re: best way to code 3 tier application

 
0
  #8
Jul 26th, 2007
i suggest:
hibernate for data layer
spring for MVC
freemarker view layer
dwr for ajax
Good news, everyone!
aykutsoysal.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC