This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP -> Bean -> Servlet, good idea?  RSS feed

 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
Building a web site and wanted to get a general opinion from more experienced java developers. Is it good practice to build the interface (JSP), that calls a Bean, that calls a servlet to inteface with DB?
What I'm getting at is the COM model calls for 3-tiers, is what I mentioned above the equiv. or is the 3-tier model not applicable in java, or is there a better way/approach?
Opinions appreciated.
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a practical design and is commonly used in many applications with minor variations. You may write a bean that takes care of the db connection and use servlet to do all the logical work. One good design pattern is the factory approach. This way you can overcome many invisible hussles in the future.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!