Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Remote Interface and Bean

 
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 ..................
 
Sheriff
Posts: 10445
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.
 
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.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic