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

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.

主站蜘蛛池模板: 清远市| 红安县| 财经| 景洪市| 封丘县| 梅河口市| 和林格尔县| 交城县| 腾冲县| 盖州市| 安溪县| 昆山市| 江川县| 当涂县| 富顺县| 湟源县| 中超| 广平县| 河间市| 鄂托克旗| 林甸县| 当涂县| 景谷| 新田县| 武鸣县| 年辖:市辖区| 阿合奇县| 炎陵县| 阜宁县| 北流市| 龙游县| 佳木斯市| 阿勒泰市| 通榆县| 尼勒克县| 搜索| 扎鲁特旗| 五家渠市| 普定县| 景宁| 佳木斯市|