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 Remote Interface and Bean 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 "Remote Interface and Bean " Watch "Remote Interface and Bean " New topic
Author

Remote Interface and Bean

Maneesh Chauahn
Ranch Hand

Joined: Mar 06, 2006
Posts: 48
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

Joined: Jul 20, 2005
Posts: 9924
    
158

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.


[My Blog] [JavaRanch Journal]
Bhaskar Rao
Greenhorn

Joined: Apr 25, 2005
Posts: 23
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Remote Interface and Bean
 
Similar Threads
Confused of Local Interface and Remote Interface
why remote interface not implemented?
A little help please
Deploying EJB on weblogic8.1
Remote Exception or EJB Exception to remote client??