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

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.

主站蜘蛛池模板: 左贡县| 冀州市| 宁明县| 庐江县| 凤翔县| 图们市| 遵义县| 敖汉旗| 常熟市| 那坡县| 文山县| 红安县| 高要市| 望城县| 内乡县| 江门市| 安陆市| 江都市| 新源县| 恭城| 萨嘎县| 石阡县| 崇州市| 广昌县| 保定市| 易门县| 望奎县| 马公市| 始兴县| 土默特左旗| 祁门县| 麦盖提县| 福鼎市| 曲沃县| 东源县| 子洲县| 永清县| 舒城县| 吉隆县| 陇南市| 包头市|