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

Question on EJB2.0 Local interface  RSS feed

 
krithika desai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If session facade is the way to go, then why not have only Local interfaces for all entity beans?
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by krithika desai:
If session facade is the way to go, then why not have only Local interfaces for all entity beans?

Exactly. if you check for example www.theserverside.com, there's a discussion about this. remote clients should never access entity beans directly. Instead, as you wrote, a facade is used to access them via local interfaces, which is faster.
enjoy...
http://www.theserverside.com/patterns/thread.jsp?thread_id=6160&article_count=32#19668
cheers
 
stara szkapa
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Ed Roman:
"This is a common issue with EJB programming�to test beans on an individual basis in this manner, you need to code its remote interface even though you only plan to use the local interface in production"
 
krithika desai
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by stara szkapa:
From Ed Roman:
"This is a common issue with EJB programming�to test beans on an individual basis in this manner, you need to code its remote interface even though you only plan to use the local interface in production"

Not sure if I got you correctly. If you are referring to testing Local beans, alteast one tool for sure (cactus) does solve the problem of testing Local interfaces by running the test within the same VM as the beans. Are there some other reasons for using a Remote interface for an entity bean?.
thanks,
krithika.
 
sameerleekha
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi krithika,
Yah u are very right. Since u are going to access the entity beans though a session facade layer, so u can have the advantage to providing the entity beans with the local interfaces to reduce the network calls.
U can make to ur project with all the entity beans accessed through the local interfaces by the session beans.
sameer
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okie fine,
I am just wondering from where i picked up this info, but surely did from a safe source.Probably from Richard Heffel.He clearly states, that there is no point in the local interface funda.As vendors employ their own methods to make the remote calls less expensive.In fact, i am not quite 2 sure about the piece of information which states that the Orion Container handles local calls in the same way as remote calls.
The debate wud countinue as to whether or not to use the local interfaces.
If anyone finds something real kewl, do paste the link in here.
:roll:
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sameer and Deepak a,
We don't have many rules at Javaranch, but our display name policy is one of them. Please read this policy and change your display name to comply with it if you wish to continue posting. Thanks.
You can change your display name here.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Deepak a:
Okie fine,
.... The debate wud countinue as to whether or not to use the local interfaces.
...

Could you support your comment with any resource ?
. Local interfaces ARE used...
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andres,
Local Interfaces are surely used, but so are remote interfaces although both the calling and the called beans reside in the same container on the same machine.
I am saying both the approaches(remote and local) almost prove equal.
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matthew... does this name help??
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!