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

Local interface and local home interface  RSS feed

 
Sudha Ugendran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between a local interface and local home interface in EJB? Please help me to find the exact demarcation in the usage of these two interfaces.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sudha:
What is the difference between a local interface and local home interface in EJB? Please help me to find the exact demarcation in the usage of these two interfaces.


Local Interface:

When both the session bean and entity bean resides in the same container and session bean make a call to the entity bean, ejb don't reqd to use the remote interface and remote home interface instead they can use local interface and local home interface. It improves the performance and reduces the network problem associated with the remote call.
It is similar to component interface i.e. declares the contracts.

Local Home interface:

Will define the bean life cycle methods.
 
Sudha Ugendran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi malli,

Thanks for your reply.But could you explain more about this localhome interface and when we use them?

Thanks in advance.
 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sudha:
Hi malli,

Thanks for your reply.But could you explain more about this localhome interface and when we use them?

Thanks in advance.


Hi,

Assume you are having a session bean and a entity bean deployed on the same ejb container and you are using session facade pattern to call a method on entity bean thro a session bean. In this case since both the beans are in the same container, session bean will act as local client to the entity bean and to call the entity bean method you don't reqd to make remote method call( In EJB1.1 we used to do so!! which is reduce the performance & unnecessary too). The Local Component Interface method is available only through the local home interface method.

Regards,
M.S.Raman
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36396
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Sudha",

We're pleased to have you here with us in the EJB forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Forum Bartender
 
Sudha Ugendran
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne,
Sorry for not following the naming policy.Actually I was in a hurry while filling up MyProfile page and I have made the necessary changes now.

Thanks & Rgds,
Sudha Ugendran
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!