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