Web Development--Presentation layer

Source: Internet
Author: User

Web Development--Presentation layer

Java applications are typically layered, with three layers: the presentation layer, the logical layer, the data layer, and the layers interacting with each other through the interface.

Today, the "presentation layer", the interface layer of the application is also called the presentation layer, specifically for graphical interaction with the user.

Typically, the presentation layer has several main functions:

(1) Display data: mainly from the logical layer to show the user to see or manipulate the data

(2) Human-Computer Interaction: Users can enter values on the interface, you can also click on some components, causing some dynamic events

(3) Submit form: Collect interface parameters, invoke logical Layer interface

The basic implementation of the presentation layer is as follows:

(1) Painting interface: By writing code to show the appearance of the interface "static" (through Html+css)

(2) Writing interface: By writing code to achieve "dynamic" function, how to write it?

How to write through the code interface?

Analysis of the function of the performance layer, need some code to complete the function is not many, there are two parts, one is the display data part, and the other is the event processing

The usual steps for writing code are summarized as follows:

The code that displays the data section is usually written in the method of the interface initialization, as follows:

A. Call the logical layer interface to get the data that needs to be presented

B. Setting up data to display on components of the interface

The code for the event handling section is usually written in the method of event handling, as follows:

A. Collecting parameters

B. Organizational parameters (data validation is generally required)

C. Invoking the interface of the logical layer to get the return value

D. Select the next interface based on the return value

    

Web Development--Presentation layer

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.