Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

local interfaces on EJB Components

 
viswanadh kasinadhuni
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kathy:
can you explain in more detail about local interfaces and do we need again a corresponding local home interface to create/lookup the local interface??
thanks
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think u might want to do some tutorial from Oracle Site... I have once tried that tutorial... That's really cool...
http://otn.oracle.com/sample_code/tutorials/fbs10g/litf/toc.htm
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always wondered why do we have 2 interfaces.
I understand the benefit of local interfaces, to bypass RMI and increase performance. Why does the developer take the burden of developing another interface for the bean to be used locally. At the time of deployment, let the deployer tool generate all the neccesarry classes for both local and remote use. Can the Vendor not identify the bean(if the bean is deployed locally or not) and use the corresponding classes. Can't the Vendor's container be smart
[ October 29, 2003: Message edited by: Vish Kumar ]
 
viswanadh kasinadhuni
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
naing,
my question is..since local interface is on the same process as the EJB Component, we can always get a reference to that..right. Then , why again going through local home interface and use create/lookup for getting the reference, just why cant we use "new" and get the reference??
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vish Kumar:
I always wondered why do we have 2 interfaces.

Here is the link, which discuss about the reason why there are two interfaces existing in EJB...
http://forum.java.sun.com/thread.jsp?thread=453842&forum=13&message=2068300
Hope it helps you something...
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Local interfaces are typically used while using the entity beans .In a typical scenario one would like to make a request to a stateless session bean which in turn would like to aggregate a whole bunch for entity beans .The entity beans in order to implement the Aggregate patterm would make use of local home interfaces and gives the data required to the stateless bean .This is typically known as Session Facade pattern.
Typically you wont be doing a look up using local home interface as they would be bundled in the samee ejb-jar.xml
Rishi
SCJP,SCWCD,IBM OOAD
 
viswanadh kasinadhuni
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this may be other use of a local interface..but according to EJB 2.0 spec., you can call enterprise beans in a fast and efficient way by calling them through their local object rather than by EJB objects and local objects implement "local interface" rather than remote interface...My question is again whats the use of "local home interface" here and is local home interface necessary?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use of interfaces makes it possible to switch over to remote interfaces in future.
 
viswanadh kasinadhuni
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt got exactly what that means pradeep. can you explain more precisely.
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMO,What pradeep meant was,the use of interfaces enables location transparency of a bean.You can access a co-located Bean today using local interface.later,if the situation requires the bean to be deployed in a remote location,you still can use its services by accessing it via remote interface.Isnt it pradeep?
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think what Siva and Pradeep pointed out earlier was fair enough, one would like to expose both the local and remote interfaces and depending upon where it is deployed , either of two can be made use of.
Rishi
SCJP,SCWCD,IBM OOAD
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic