|
You want to hide clients from the complexity of remote communication
with business service components.
- You want to access the business-tier components from your presentation-tier
components and clients, such as devices, web services, and rich clients.
- You want to minimize coupling between clients and the business services,
thus hiding the underlying implementation details of the service, such
as lookup and access.
- You want to avoid unnecessary invocation of remote services.
- You want to translate network exceptions into application or user
exceptions.
- You want to hide the details of service creation, reconfiguration,
and invocation retries from the clients.
Use a Business Delegate to encapsulate access to a business service.
The Business Delegate hides the implementation details of the business
service, such as lookup and access mechanisms.
Class Diagram
Sequence Diagram
- Delegate Proxy Strategy
- Delegate Adapter Strategy
- Reduces coupling, improves maintainability
- Translates business service exceptions
- Improves availability
- Exposes a simpler, uniform interface to the business tier
- Improves performance
- Introduces an additional layer
- Hides remoteness
- Service Locator
The Business Delegate typically uses a Service Locator to encapsulate
the implementation details of business service lookup. When the Business
Delegate needs to look up a business service, it delegates the lookup
functionality to the Service Locator.
- Session Façade
For most EJB applications, the Business Delegate communicates with a
Session Façade and maintains a one-to-one relationship with that
facade. Typically, the developer who implements a Session Façade
also provides corresponding Business Delegate implementations.
- Proxy [GoF]
A Business Delegate can act as a proxy, providing a stand-in for objects
in the business tier. The Delegate Proxy strategy provides this functionality.
- Adapter [GoF]
A Business Delegate can use the Adapter design pattern to provide integration
for otherwise incompatible systems.
- Broker [POSA1]
A Business Delegate acts as a Broker to decouple the business-tier objects
from the clients in other tiers.
|