Reading the �Core
J2EE Patterns � Best Practices and Design Strategies�, I don�t find it convincing enough to use Business Delegate.
The relationship between a business delegate and a business service is 1-1. A business delegate is on the presentation tier, and a business service is on the business tier.
In my opinion: If we implement a business service as an EJB, the business service has a stub on the presentation tier, which KINDA works a business delegate. I don�t find it convincing enough to use business delegates although I can find some minor reasons to use it.
Why Business Delegate:
1. Business delegate translates business tier exceptions into more presentation friendly exceptions.
Why Not Business Delegate:
1. The service look up code is always on the presentation tier no matter we place the service look up code in either a
Servlet or a business delegate. Why bother to create an extra business delegate?
2. According to the book, business delegate is supposed to hide underlying implementation detail of business service from the presentation tier. In my opinion: with a business service as an EJB, the Remote Interface of the business service only exposes the business methods to the presentation tier. Since an EJB can achieve the same result, why do we need business delegate?
�Clients may need to implement caching mechanisms for business service information� (Page 248). Would anyone give me some explanations?
Thanks much in advance. I know you folks are the best. :-)