Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Ejb Beginner

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to Ejb, I have doubt why cant we implement methods in remote itself,why we need to go for separate bean class.
thanks
Sudharsan tettu
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudarshan,

Remote is an interface, which specifies the APIs available to the EJB client. The bean class is an implementation of this interface.

Let us know if you were looking for something else
 
sudharshan tettu
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you for your reply
But my doubt is why Ejb is framed like that.
Whats real need for remote interface.....
why it is not directly bean . Why do we need remote in between client and a bean.

thank you
 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by sudarsan tettu:
Why do we need remote in between client and a bean.thank you



Good question. You might want to check EJB 3.1 features.
 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudarsan,

There are two simple reasons for EJB interfaces:

1. To enable stub objects injected into interfaces for unit/integration testing. That being said, EJB 3.1 introduces no-interface local beans.
2. To enforce loose-coupling between clients and implementation code. This is especially true for remote clients. I can't think of a single technology, Java or otherwise, that allows direct access to implementation objects for remote clients.

Regards,
Reza
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more reason which I could see here . Enterprise Beans are not remote objects. Client and Enterprise beans do not share same heap and hence clients can not communicate directly to enterprise beans. So we have remote and home interfaces to safe guard enterpise beans from any direct interaction. As per Head First EJB, remote interface is like a body guard to enterprise bean and every communication should go only through him. If at all anything can communicate to enterprise bean it can be only container.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a doubt please clear...

As per EJB 3.1 we don't have the need to implement the local and the remote interfaces to the session bean which we need to make use of the remote and the local interface methods.
 
Hot dog! An advertiser loves us THIS much:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic