File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes OO, Patterns, UML and Refactoring and the fly likes Diff between business delegate, sessionfacade and service-locator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Diff between business delegate, sessionfacade and service-locator" Watch "Diff between business delegate, sessionfacade and service-locator" New topic
Author

Diff between business delegate, sessionfacade and service-locator

kundan varma
Ranch Hand

Joined: Mar 08, 2004
Posts: 322
Hi All
I am confused about the differences between business delegate, sessionfacade and service-locator patterns.
Can some body explains and draw a thick line between them

Thanks
kundan


SCJP1.4,SCBCD,SCEA,CNA
Failures are practice shoots for success.
Vagner Freitas
Ranch Hand

Joined: Aug 02, 2004
Posts: 85
Hi Kundan.

Let me see if I can explain it for you.

Session Fa�ade are intented to be a fa�ade to the business objects. All business rules have to be in it. You shoud use Session Facade to control de flow of the use case. Session Facade can access all Business Objects related with use case. Generaly it is implemented as SessionBean.

Bussiness Delegate are used to decoupling the presentation layer from the bussiness layer. As Session Facade is implemented as SessionBean, Bussiness Delegate hides the complexity of working with EJB from the client in presentation layer. And Business Delegate should catch any EJB exception and convert it in exception known for the client.

Service Locator is used for the Business Delegate to locate de proper SessionBean. Service Locator hide from Business Delegate the complexity of working with JNDI. And Service Locator should cache the home reference for SessionBean to avoid call JNDI API every time.

Sorry for English, I have been learning it yet.

Vagner


SCJA, SCJP, SCBCD & SCEA (Part I)
kundan varma
Ranch Hand

Joined: Mar 08, 2004
Posts: 322
Thanks it was really a clear explanation.
And believe me your english sounds very sweet.

Thanks
kundan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Diff between business delegate, sessionfacade and service-locator