• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

General question of EJB!!

 
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Folks,
Why do we need Home and Remote Interface in EJBs?Why can't we keep both business methods and life-cycle methods in any one interface instead of two interfaces...any specific reason.Please help me out.
Regards,
Ravi
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just beginning to wrap my arms around EJB, but, for the purposes of stretching my brain and contrasting my answer with other folks, thoughts include:
* Home vs. Object interfaces give the container more flexibility in how it implements getting remote clients to instances of business logic/data. More flexibility lets containers optimize in various ways, re: caching, loading, etc.
* Once the remote client has a handle to the EJBObject stub, it may no longer need the EJBHome interface object, and so can let that object go to be garbage-collected.
* Just general, good, class/interface design where the interface doesn't attempt to accomplish two fundamentally separate kinds of things (lifecycle management vs. business methods).
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can think of the Home interface as really being a factory for creating/locating your actual EJBObjects. In general it's a good design to separate your business object interface (Remote interface) from the
interface that manages the location/life-cycle of your business objects. You should not mingle up the two.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic