This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Why EJB need interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Why EJB need interface" Watch "Why EJB need interface" New topic

Why EJB need interface

karthik kummar

Joined: Jun 23, 2010
Posts: 11
Hi Friend,
I have one chilly doubt, why we are using interface(LOCAL and REMOTE) in EJB. could you please explain.
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30057

To separate definition from implementation. And in the case of remote so as to not share the implementation.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
nirmal singh

Joined: Feb 07, 2008
Posts: 6
Hi karthik the reason behind is ejb are built for accessing remote enviroment which is completely different from the working as to establish the connection bw a stub and skeleton we use these interfaces as a common skeletal environment.thanks in advance :-))
malgo douginos

Joined: Jan 08, 2012
Posts: 2
I still don't understand, a program is already written,
so if it calls the third method of the interface it means it ALREADY knew that this method was in the interface, and it also already knew it's signature.
so why bother to retrieve the interface, why not just send "execute methoda(param b);" ?!
James Boswell

Joined: Nov 09, 2011
Posts: 1012

Sounds to me like you need to read up on the benefits of using interfaces. This is more than just an EJB issue.
wood burning stoves
subject: Why EJB need interface
Similar Threads
ejbCreate in MDB
why remote interface not implemented?
What is the need for EJB to get reference to Home interface?
EJBHome and EJBRemote interface
Home and Remote interfaces