• 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

'coarse-grained' interface to clients

 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

wrap up multiple entity EJB operations within a session EJB. Ensure that the session EJB begins a transaction that encompasses the entity operations, or has transaction attributes that cause the container to do so.

This is one of the reasons that most authorities recommend the use of session EJBs as a facade to an entity EJB system. Other reasons include the ability to cache entity data in the session EJBs, and the provision of a `coarse-grained' interface to clients.



What does it mean 'coarse-grained' interface to clients.........?
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joseph,

Suppose you have 3 EJBs A, B and C which has methods a(), b() and c() respectively. These methods are fine grained methods and can be reused. However, when you want to expose a business method to the client you want to write a Session Facade pattern [EJB D with method d()] which internally invokes these methods and does some business logic and data manipulation to return a more appropraite object which the client is interested. So your business logic is encapusulated in the business facade and client need not have to write the similar logic in his JSP/Servelt which does't handle transactions. Please read Business Facade pattern for more understading of this pattern and to learn its advantages.

Regards,
Amit Tank
 
Joseph Sweet
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation,

what does it mean: to cache entity data in the session EJBs?
 
Amit M Tank
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might want to have your custom Cache in the Session Bean. But it really doesn't make much sense to cache the Entity data (if the data is not much transactional and doesn't change that often) on the Session Bean side. Most of the appliaction servers like weblogic provides their own Entity Cache.

Regards,
Amit Tank
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic