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

Tiers

A tier is a physical unit, and it is related to hardware and software components. It is the infrastructure in which the layer components are deployed and executed. Examples of tiers are web browsers, application servers, and database servers. A typical n-tier application is defined with the following tiers:

 

Let's look at the following diagram:

Here, it is very important to note the difference between the client tier and the presentation tier. The client tier is where a client application is executed (through platforms such as a browser or a mobile application). Generally, the client tier is the client machine or device, and the presentation tier is represented by the web server. The presentation tier receives a data request from the client tier, prepares the data (with some format defined previously, if necessary), and sends it to the business tier. This is the classic mechanism of how data is processed in a JEE scenario. We can identify some technologies in the presentation tier, such as Servlets, JSP, JSF, WebSockets, JAX‐RS and JAX‐WS, Java API for JSON processing, JSON-B, CDI, and bean validation.

Let's look at the following diagram:

As previously discussed, it is in the business tier that all business logic is executed. The presentation tier is the client of the business tier because it requires operations of the business tier and receives the result that comes from the business tier. At this point, we can see an additional responsibility for the presentation tier, which is to locate the service and make the request. It would be interesting if we had a mechanism that delegated the request to the real service. This is the role of the Business Delegate pattern, which prevents details of the business tier services from being exposed to the presentation tier. The coupling between the presentation and business tiers is reduced, and therefore modifications in the business tier have a minimal impact in the presentation tier. 

The Business Delegate pattern acts as an input door for the client. It is responsible for receiving the request, identifying or locating the real business service, and calling the service sending the request. After that, the delegate receives the service response and then sends the response back to the client.

主站蜘蛛池模板: 德江县| 化州市| 枣庄市| 化州市| 富蕴县| 汨罗市| 宽城| 镇平县| 阿瓦提县| 彰化县| 罗田县| 五家渠市| 延吉市| 英山县| 大余县| 始兴县| 墨脱县| 镇巴县| 秀山| 搜索| 乌什县| 揭西县| 颍上县| 彭泽县| 新沂市| 海城市| 专栏| 新营市| 花垣县| 桓仁| 彭州市| 新干县| 奉贤区| 天柱县| 日照市| 丽水市| 敦煌市| 南部县| 布拖县| 双辽市| 西吉县|