Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why EJB need interface

 
karthik kummar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friend,
I have one chilly doubt, why we are using interface(LOCAL and REMOTE) in EJB. could you please explain.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To separate definition from implementation. And in the case of remote so as to not share the implementation.
 
nirmal singh
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi karthik the reason behind is ejb are built for accessing remote enviroment which is completely different from the working environment.....so as to establish the connection bw a stub and skeleton we use these interfaces as a common skeletal environment.thanks in advance :-))
 
malgo douginos
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds to me like you need to read up on the benefits of using interfaces. This is more than just an EJB issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic