This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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)?
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)?
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
posted
0
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
posted
0
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
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.