Introduction to Program Architecture and MVC

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

Introduction to Program Architecture and MVC

B/S server-----browser

C/S server-----client

Heavy server and light client is BS architecture! The browser is a kind of light client. Everything in it is loaded from the server! You don’t need to install any plug-ins! Heavy server means that everything you use is on the server! Server pressure is heavy!

Program Architecture:

JS architecture means database code, logic code, HTML code, EL, JSTL are all written on the page

JS + Servlet js+jstl+EL, etc. as interface Servlet is used for database connection logic data verification

JS+Servlet+JavaClass js+El+Jstl is used for interface Servlet for data validation JavaClass is used for logic and database operations

After all, servlet needs tomcat.... container to run. If we don't need servlet in the future, then the js and javaclass of your program can still be used without pushing to redo!

MVC

M model V view C controller is specially used to deal with spider web interaction Speaking of now my WEB page is very messy jsp1 jump jsp2 jsp3 jump jsp4... as shown below

image

Mvc is like a relay, you tell the controller what page you want to jump to and let the controller handle it, so that you don't need to maintain any page jumps and just change the controller directly! As shown below:

image

Model1: View >> Controller >> Model >> View

For example, on a web page form, you click submit and submit it to the controller, and then the controller transfers the submitted form to the Servlet/Filter, and then your servlet/filert returns data to the web page!

image

Model2: View >> Controller >> Model >> Controller >> View

For example, if you click on the form of a web page and submit it to the controller, you will register the submission controller and transfer it to the model model to get the data to determine whether the data is legal, then return the data to the controller, and then the controller will respond to the page to the web page!

image

Both the Struts2 framework and the SpringMVC framework implement the MVC2 pattern. With their framework, there is no need to implement the MVC pattern by hand!

The three-tier architecture is the three-tier architecture. The MVC is the MVC. They are not related to each other. If they are to be related, MVC can only be regarded as one layer of the three-tier architecture.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326324363&siteId=291194637