File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Keeping EJB as Client ? 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 "Keeping EJB as Client ?" Watch "Keeping EJB as Client ?" New topic

Keeping EJB as Client ?

vikasids sharma
Ranch Hand

Joined: Aug 01, 2003
Posts: 157
hi all
My ejb client calls for a session bean. Now i want this session bean to call some entity bean which resides at different application server.
Please let me know which out of two options is better and why?
1. I make this session bean as client for entity bean existing at diiferent server and calls it using JNDI.
2. I make a call to session bean and on the basis of what it returns makes call to another session bean(this session bean further calls entity bean)existing at different application server from same client code.

Vikas Sharma
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
I'd vote for option 1.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
Definitely go with number 1. The client shouldn't need to know all the gory details...
Naveen Sharma
Ranch Hand

Joined: Mar 23, 2001
Posts: 65
Go with a clean approach ... No. 1
I agree. Here's the link:
subject: Keeping EJB as Client ?
jQuery in Action, 3rd edition