官术网_书友最值得收藏!

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:

主站蜘蛛池模板: 怀化市| 麻阳| 饶河县| 应城市| 田东县| 乳山市| 彭水| 太谷县| 根河市| 北京市| 沧源| 仙游县| 盘山县| 长寿区| 洞头县| 仪陇县| 略阳县| 安化县| 剑河县| 合作市| 土默特左旗| 阿克苏市| 溧阳市| 丹东市| 库伦旗| 平远县| 县级市| 高碑店市| 扎兰屯市| 闸北区| 米脂县| 道真| 饶阳县| 会泽县| 郑州市| 雷山县| 芮城县| 麟游县| 板桥市| 元谋县| 荆州市|