Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!