Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interaction b/w Managed Bean and Web Service

 
Medha Polishetty
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 45
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
s patnaik
Ranch Hand
Posts: 45
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic