File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ejb Beginner

 
sudharshan tettu
Ranch Hand
Posts: 126
  • 0
  • 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
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • 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
  • 0
  • 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
 
Srikanth Basa
Ranch Hand
Posts: 241
  • 0
  • 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.
 
Reza Rahman
author
Ranch Hand
Posts: 580
5
  • 0
  • 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
 
Schandha Ravi
Ranch Hand
Posts: 167
  • 0
  • 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.
 
Hari Dhanakoti
Ranch Hand
Posts: 74
  • 0
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic