Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why do we need Home and Remote Interface?  RSS feed

 
Anup Katariya
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
 
Naidu Jitta
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!