File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Interaction b/w Managed Bean and Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Interaction b/w Managed Bean and Web Service" Watch "Interaction b/w Managed Bean and Web Service" New topic
Author

Interaction b/w Managed Bean and Web Service

Medha Polishetty
Greenhorn

Joined: Aug 01, 2011
Posts: 14
If the managed bean need to get some data or update some data by calling the web service, then which would be best way
1. Managed bean --> Business Delegate --> Service Locator --> Stateless session bean(Session Facade)--> Calling the Web Service
2. Managed Bean--> Business Delegate (Assuming Server Side Component )--> Calling the Web Service

Which would be best Approach?

Hope some can answer my question

Thanks,
-Medha
s patnaik
Ranch Hand

Joined: Jul 17, 2011
Posts: 45

Managed bean --> Business Delegate --> Service Locator --> Stateless session bean(Session Facade)--> Calling the Web Service


I assume BD is a POJO here. The Stateless session bean that invokes the web service looks more like a DAO to me. Does it hold any other business logic as well?. I assume not(Assumption 1).

Managed Bean--> Business Delegate (Assuming Server Side Component )--> Calling the Web Service


I assume here that BD is a stateless session bean(Assumption 2).

(At the risk of oversimplifying,)If both my above assumptions are true, the choice is between using service locator(your Option 1) or dependency injection(your Option 2).

You have to choose one or the other. This article is a good read.

-SP


SCJP 5, OCPJP7, OCMJEA 5
s patnaik
Ranch Hand

Joined: Jul 17, 2011
Posts: 45

Hey here is a discussion on the same topic -

http://www.coderanch.com/t/518596/java-Architect-SCEA/certification/Business-Delegate-Stateless-Session-Bean

Is there a topic that is not discussed on this forum !
Medha Polishetty
Greenhorn

Joined: Aug 01, 2011
Posts: 14
s patnaik wrote:
Managed bean --> Business Delegate --> Service Locator --> Stateless session bean(Session Facade)--> Calling the Web Service

I assume BD is a POJO here. The Stateless session bean that invokes the web service looks more like a DAO to me. Does it hold any other business logic as well?. I assume not(Assumption 1)


If i Use the dependency Injection i could avoid the Service Locator b/w the Business Delegate and Stateless session bean . This was brining me one another question with the data which is coming from the Webservice if I'm not changing anything or if i dont have the business logic I'm just wondering do i still need to have the Session Bean? Or Can i simply have something like this

Managed bean --> Business Delegate -->Calling the Web Service , Here my business delegate acting like converting all the remote exception to application specific exceptions and caching the results. Is this is a good approach?



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interaction b/w Managed Bean and Web Service