Quick review, talk about mvc thinking

Encyclopedia

The full name is Model View Controller, an abbreviation of model-view-controller, a design pattern, that is, a problem-solving method and idea

Purpose

The purpose of using MVC is to separate the implementation code of M and V , so that the same program can use different forms of representation; guide developers to decouple , and improve the reusability of code, especially the code of the model part

composition

advantage

Ruan Yifeng talks about mvc

If the MVC pattern is interpreted as a three-layer structure of "appearance", "mechanism" and "function/data" , then many human organizations can also be structured through the MVC pattern.

For example, a shopping mall can be divided into three parts. One part is the warehouse , which is responsible for providing goods, which is the "functional layer" (or "data layer"); the other part is the retail storefront , which is responsible for selling goods, which is its "appearance layer"; between the two is the "mechanism layer" , including the mechanics of all interactions between the counter and the warehouse.

After this distinction, the structure of the mall becomes very clear, and can be optimized for different layers to improve efficiency

Typical MVC

  • Pattern of JSP + servlet + javabean

Recommended reading

Essential Skills for Architects (Part 1)

Essential Skills for Architects (Part 2)

finally

Welcome to the public account of java mind map, and reply to "mind map" to download the source map file in the article. Mind map to learn java, so that java is no longer difficult to understand.

Scan to pay attention to the public number of java mind map.jpg

Guess you like

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