File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Ejb Beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Ejb Beginner" Watch "Ejb Beginner" New topic
Author

Ejb Beginner

sudharshan tettu
Ranch Hand

Joined: Jul 17, 2006
Posts: 124
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

Joined: Jul 20, 2005
Posts: 10102
    
165

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


[My Blog] [JavaRanch Journal]
sudharshan tettu
Ranch Hand

Joined: Jul 17, 2006
Posts: 124
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

Joined: Jun 06, 2005
Posts: 241
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

Joined: Feb 01, 2005
Posts: 580
    
    5
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


Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Schandha Ravi
Ranch Hand

Joined: Oct 20, 2007
Posts: 167
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.


Thanks & Regards, SK
SCJP 5.0, DB2 - 800, DB2 - 803, SCDJWS (On the way)
Hari Dhanakoti
Ranch Hand

Joined: Jan 07, 2008
Posts: 74
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.


Regards,
Hari
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ejb Beginner