Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remote Interface and Bean

 
Maneesh Chauahn
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

As i am new in the EJB , i am looking the architecture of the EJB . One thing which i am unable to understand is that
Why the bean class not implement the remote interface and why is mandatory to define all the methods in the bean which are defined in the remote interface.

Waiting for the reply ..................
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why the bean class not implement the remote interface


The bean class can implement the interface. There's no rule which stops the application from doing this.

why is mandatory to define all the methods in the bean which are defined in the remote interface


The remote interface is meant to used by the clients of the application. So any API that you provide on the interface needs to be implemented by the implementing class(in this case your bean class). This holds good not just for EJBs but also for normal interface/implementation class in Java.
 
Bhaskar Rao
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean class can implement the remote interface, but its not advisable.
Implementing the remote interface will make the bean class remotely accessible .

Also, you will be required to implement all the inherited methods from the EJBObject like getEJBHome(), getHandle() etc. which is really upto the container to implement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic