Java Web Learning notes-MVC

Source: Internet
Author: User

A variety of design patterns are used in the proxy categories that contain the ACCESS database generation: Factory method, number of access objects, various ORM technologies (hibernate, EJB );

MVC:

M: model. Represents the applicationProgramIs responsible for processing user data and implementing business logic;

V: View. Indicates the interface.

C: controller. It is responsible for receiving user requests and data, then determining which model the request and data are handled by, and finally calling the view to display the data returned by the model.

 

There are two classic models in the Java Web field, also known as the implementation modes: model1 and moder2.

Model1: JSP (V and c) + JavaBean (m): a large number of HTML tags are mixed with Java statements, which is not conducive to maintenance;

Model2: JSP (v) + servlet (c) + JavaBean (m ). When a user sends a request to the server through a browser, the component receiving the request is changed from the original JSP to servlet. Servlet calls corresponding Javabean to process user requests based on its own logic judgment. Javabean is responsible for business logic processing and data persistence. After the processing is completed, JavaBean returns the result and returns it to the client's browser on the JSP page.

Summary: in the B/S structure, applications are generally divided into presentation layer, business logic layer, and data persistence layer, and database access operations correspond to the persistence layer.

The most common method for encapsulation of the persistent layer is the Data Access Object Mode (DAO ).

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.