Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning a Remote interface from a Local interface

Status
Not open for further replies.

Stedo

Programmer
Sep 15, 2005
44
SE
hi,

Is it possible to return a Remote interface from a Local interface? I have a client which I want to have access to the Remote interface but not have access to the Home interface, so I want to create the Remote interface on the server and pass it to the client. But I don't know how to create the Remote interface when using the Local interface. Can anyone help?

Thanks
Steve
 
What you need to remember is that with EJB remoting, you're not really dealing directly with server classes from the client. There are proxy objects in-between which handle the communication and marshalling. Additionally, any object which you want to send 'over-the-wire' has to be serializable, and I would doubt whether a proxy (since that is really what your dealing with when you're talking about Remote Interfaces) is.

What your proposing hardly seems like 'Best Practice' for a client/server architecture. What are the requirements which are prompting you to consider such a solution?

If you want the client to be insulated from such concerns as talking to remote EJBs (which is desirable) then you'd be better coding to pure business (service) interfaces within the client, have the server remote interfaces extend these, and introduce an abstraction layer between the client and these business services which handles the EJB lookups and home interfaces.

A lightweight framework called Spring can help with this (
You might also consider posting a question on the OO analysis and design forum (forum678). There are guys there who can give detailed solutions to problems like this, but try searching it first. It's probably already been dealt with before.



Tim
---------------------------
"Your morbid fear of losing,
destroys the lives you're using." - Ozzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top