- Java EE 8 Design Patterns and Best Practices
- Rhuan Rocha Jo?o Purifica??o
- 251字
- 2021-07-23 16:54:56
The classic Business Delegate pattern scenario
In a classic Business Delegate pattern scenario, the implementation of the Business Delegate pattern receives a request from a Java client and sends the response back to it. In addition, to minimize the coupling between the presentation tier and the business tier, it was the responsibility of a delegate to locate remote services (in most cases, a remote EJB service) and provide a caching mechanism for accessing business services to reduce the network traffic.
So, when EJB was used as a remote service in the past, Business Delegate patterns were used with another pattern, the Service Locator Pattern, which is responsible for locating the remote (and local) EJB. Also, the stub (a kind of EJB reference based on the RMI (Remote Method Invocation) protocol) of the remote EJB is cached by the delegate.
The following diagram shows the class diagram for the Business Delegate pattern. This represents the basic structure of this pattern. The client sends requests to the Business Delegate, which in turn accesses the correct business service. The Business Delegate can use a service locator in the case of a remote service lookup:

As the Business Delegate re-passes the business request to the Business Service, one natural approach in code development is to make both classes (Business Delegate and Business Service) implement the same business interface.
This is shown in the following diagram:

In the following diagram, we show the sequence diagram for the Business Delegate pattern:

- Instant Handlebars.js
- 精解Windows8
- 嵌入式Linux驅(qū)動程序和系統(tǒng)開發(fā)實例精講
- 深入Linux內(nèi)核架構(gòu)與底層原理(第2版)
- 嵌入式系統(tǒng)原理及開發(fā)
- AWS Development Essentials
- AutoCAD 2014中文版從入門到精通
- Learning Magento 2 Administration
- Linux命令行大全(第2版)
- 大學(xué)計算機應(yīng)用基礎(chǔ)實踐教程(Windows 7+MS Office 2010)
- openEuler操作系統(tǒng)核心技術(shù)與行業(yè)應(yīng)用實踐
- 基于Arduino的嵌入式系統(tǒng)入門與實踐
- Microsoft DirectAccess Best Practices and Troubleshooting
- 數(shù)字系統(tǒng)設(shè)計與VHDL
- Windows PE權(quán)威指南