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