This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Diff between business delegate, sessionfacade and service-locator

 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
kundan varma
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it was really a clear explanation.
And believe me your english sounds very sweet.

Thanks
kundan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic