Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

why we need home interface in EJB 2.0

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I cant understand why we need a home interface?

As we receive home interface using JNDI and then get EJBObject and then call our business methods......Can we get EJBObject using JNDI and then call business the method?

regards,
Ajse
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The home interface is something behind which the container can plug in the barricade of features by creating stubs. When you get a reference to the home interface, in effect you are getting a reference to a container generated stub which in turn delegates your call to the EJBObject implementation.

By calling the EJBObject directly you loose on two major features a)location transparency (although EJB2.0 helps you avoid that) b) Feature overlap, like transaction, security etc that is transparently provided by the container.

Regards,
Sandeep Deb
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EJBObject exists on the server side
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roy,

we can't do that coz if you try to bind EJBObject as a JNDI object how you acheive following things :

1. Multiple client request handling
2. Method invocation on that object i.e. who will pass and reterive all passed parameters to your method.
3. How you handle Tx.

and many more... So its better to bind EJBHome which is nothing but it is factory class which know how to do all this stuff for you.
hope that this make more clear picture

Cheers,
Sunil Dixit
 
Are you okay? You look a little big. Maybe this tiny ad will help:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic