MVC Instance Application pattern

Source: Internet
Author: User

MVC Mode in Java Web instance analysis in the application

一、六个 Basic Properties

Usability : Use unusual tactics, Set valid judgments in action, and deal with errors to some extent

Modifiable Tactics : Programming for interfaces, modifying code for one method without modifying other parts of the code

Performance Tactics : Increase The maximum number of Tomcat connections (this is not very much related to MVC)

ease-of-use tactics :mvc hierarchies views, controllers, and data;

which JSP the interface is the view

Domain for the Model

Action responsible for controlling interface jump and data transfer, i.e. controller

The use of these three parts allows the user interface of the system to be separated from the rest, and the other parts may not have to be modified when the user interface changes.

testability Tactics : This is also for interface programming, when testing a module of a function, some of the other modules of the method can be defined only in the interface, but do not have to implement.

Security Tactics : Users need to log in to perform basic operations, to prevent unauthorized users of the system of some operations.

second, the analysis of specific functional modules MVC Design Implementation

Login example.

index.jsp for the implementation of the user interface as a view

Student.java , for the implementation of the model

login.action data delivery and request sending

Iii. Concrete application or analysis in the actual project MVC application of design patterns in specific Web sites (examples need to be enumerated)

Blog Park Example

What is presented to us is a view, each person's view is different, it is equivalent to each person's corresponding model of the data to be reflected on everyone's interface

When we want to view an article, when we click on a title, the controller of the webpage receives the request, and after it is delivered to the corresponding section, he returns the data to the user view, which is the whole of the article we see.

MVC Instance Application pattern

MVC Instance Application pattern

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.