Mode and architecture Reading Notes enterprise application architecture model II

Source: Internet
Author: User
Tags xslt

Chapter 4 Web Presentation Layer

the presentation layer has many specific forms: Web page, Windows dialog box, command line, mobile phone screen, and so on. When discussing the presentation layer, the author focuses on Web presentation layer. Although Web applications do not completely replace other table forms, but there is no doubt that, it is one of the mainstream in the future.

Prepare to develop Web Application, starting from the server software. Build Web Applications on serversProgramThere are two main methods: script and Server Page. .Script formIs a program that calls functions or methods for processing. HTTP And Html The result is output to the client through a stream. Examples include: CGI Steps and Java Servlet .Server PageIn Html Embedded scripts in the pageCodeSuch examples include: PHP , ASP And JSP . The advantage of script form is that it is powerful, and the disadvantage is that it takes more time to understand and format Html Output, which leads to more workload. The advantage of the server page is that the final output is almost WYSIWYG, and the disadvantage is that the Code is scattered in the page, which is difficult to maintain. BTW In this regard, ASP. NET The development platform combines the advantages of both, and provides background code separation while supporting WYSIWYG, greatly improving the development efficiency.

Because the script method is very suitable for interpreting request messages, the server page is very suitable for formatting response messages. Therefore, you should use the script language to interpret request messages and use the server page to format response messages. This separation of usage is actually an old idea. It first appeared on the user interface using Model-View-controller.. (Because the controller here is actually mainly used to interpret and process user input, the author prefers to use the term "input controller". Of course, the Controller has another understanding:Process the application stream to determine the order in which the view should appear)

Three Views can be considered: conversion view, template view, and two-step view. .Template ViewIt is easy to understand, that is, it is designed Html The page is a template and embedded code in the page;Conversion ViewThe most common example is XSLT , Selected by the input Controller XSLT Style form, and then apply it to XML In other words XSLT Set XML Convert the calculation result Html Page. Both the conversion view and template view generate the final user interface directly from the domain data, which is completed in one step, called the single-order view.Two-step ViewThis process is divided into two phases: a logical screen is generated from the domain data, and a unified view is used to generate a user interface. After reading the two-step view several times, the two-step view still cannot be well understood. The main reason is that the actual application cannot be found. What are the specific (not theoretical) applications of the Two-Step view? Which of the following friends can help explain the problem. For the two-step view, extract the original text from this section:

If Web the services provided by applications are used by a variety of front-end users, so using the two-step view is more handy. For example, many airlines use the same basic ticket booking system in the background. Under the limitation of the logical screen, different front-ends can obtain different visual views due to different second stages. Similarly, you can use two-step view to process different output devices. For example, you can use different stages to differentiate Web browser or handheld computer. Furthermore, sharing a public logical screen between two user interfaces is also very limited. When these two user interfaces are very different, such as between the browser interface and the mobile phone screen, this sharing is basically impossible .

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.