aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Remote and Home Interfaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Remote and Home Interfaces" Watch "Remote and Home Interfaces" New topic
Author

Remote and Home Interfaces

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I understand what remote and home interfaces are, their methods and mechanics. My question is why EJB needs two interfaces (four interfaces in the case of EJB 2.0)?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

Home interface is used for finding,creating and removing EJB'S whereas Remote i/f containd business methods.

Originally posted by JiaPei Jen:
I understand what remote and home interfaces are, their methods and mechanics. My question is why EJB needs two interfaces (four interfaces in the case of EJB 2.0)?


Groovy
Rick Salsa
Ranch Hand

Joined: Jul 17, 2001
Posts: 173
Originally posted by JiaPei Jen:
I understand what remote and home interfaces are, their methods and mechanics. My question is why EJB needs two interfaces (four interfaces in the case of EJB 2.0)?

We'll, remote interfaces use RMI (Remote Method Invocation). Prior to EJB 2.0, all communication was done with RMI. This adds a lot of overhead and puts a lot of information (java objects) on the network. Every call to Entity bean would be an RMI call, even if the bean was in the same container.
With local interfaces, the app server is now aware that the Entity bean is in the same server and does not need to make an RMI call to access it or run a method. All Entity bean calls happen in the server, so there is no overhead related to RMI in this situation.
HTH and didn't confuse you more,
/rick
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I said that I understood what EJB interfaces and what they did. My question is not answered. My question is "why EJB needs those interfaces". Anybody could shed light?
ipog
Greenhorn

Joined: Jan 16, 2002
Posts: 10
This is purely to segregate the functionality that each is performing.
Home as
1)Factory of Remotes
2)life cycle management of beans
Remote as
1)reference to bean instance
2)business methods
The concept of factory and remote comes from CORBA.
Laudney Ren
Ranch Hand

Joined: Jan 06, 2002
Posts: 111
the answer is: Container provides functions as a proxy between ejb callers and the ejb. the interfaces are implemented by the Container. container generates some classes and their stubs. Those classes' stubs are sent to the client. Thus, Container can add in multiple functions such as Transaction, Persistence Management, Security and various optimization like poolings.


" Veni, vidi, vici "<br />" I came, I saw, I conquered "
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Remote and Home Interfaces
 
Similar Threads
ejb-ref tag in the DD contains any redundancy?
Question on EJB Architecture
Combining Home and Remote interfaces in EJB
How to compile the EJB client codes at the remote JVM?
can you tell me which one is correct???