• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Design Question using EJB3.0

 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my servlet



This is my Remote interface



This is my SessionBean class where i directly implemented the logic



Now my question is it a good pratice to directly implement the logic inside the SessionBean .

I want to ask what is the general approach followed where we need to contact the DataBase for some operations .Please help.

waiting for your suggestions.
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is my question vague ??
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pavan,

This is a question that most EJB 3/Java EE 5 references cover in detail (EJB 3 in Action certainly does). As a brief summary, the choice is really up to you. You can put business logic in session beans while using a separate DAO layer to encapsulate persistence code. This is the traditional Java EE layered architecture. If you wish, you can omit the DAO layer while using JPA. Some folks have argued that JPA makes the DAO layer obsolete. You can also use domain driven design (DDD) and put business logic in domain objects that are invoked by session beans.

Hope it helps,
Reza
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reza , thanks for your excellent explanation
 
today's feeble attempt to support the empire
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic