• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Why do we need Home and Remote Interface?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recently I have been asked this question in interview.
To that my answer was,
1. Home interface is to create a bean instance(s) or getting a instance(s) from pool.
2. You bind your home stub with directory service (JNDI) so that your EJB become portable. As a client you dont have to worry about where EJB is deployed.
I feel these answers are correct to some extent. But somehow I am not satisfied with this answer. I think I am missing something important.
Could we have only one interface?
Please correct me.
Regards
Anup
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai Anup,
Home interface is responsible for the life cycle management of the bean.(creating and destroying)
Remote interface will handle all the business logic of the application.
With Regards,
J. P. Naidu
 
Anup Katariya
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello J.P.
I understand what you said. My question is can we have only one interface technically?
I agree that role of Home and Remote interfaces are quite different and thats why they exist. But since our implementation of methods goes in one EJB (bean class), we should be able to use only one Interface.
I am not doubting the EJB design, just trying find out whether "technically" one interface is possible or not(even though its a bad design).
Thanks,
Anup
 
Naidu Jitta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai Anup,
No it is not possible according to the specifications. First of all u can't even deploy the bean with out the home and remote interfaces.
with regards,
J. P. Naidu
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic