This article mainly introduces an MVC pattern.
1, recently looking at a Golang framework (Beego), so there is a basic understanding of the MVC pattern . In short, the MVC pattern is one of the architectural patterns , the most common one, the web framework, and the software architecture are done through the MVC pattern.
2. To expand, the MVC pattern is the abbreviation for three words:model, view,and Controller (Control), and we will explain the meaning and function of the three layers from the top down.
· View: This layer can be literally "view layer", provide user interface, is the shell of the program. If you put it in web development, it's what we're showing on the front end.
· controller: This layer we can call the "control layer" to provide the underlying interface for the content on the view, for example, to implement various method in the front end.
· Model: This is the bottom layer, mainly the data or information that the program needs to manipulate, most of the way it interacts with the database, or it needs to be reused in the controller layer.
3, the three layers are closely linked together, but independent of each other, each layer is finished to provide the interface for the above layer call. In this way, software development can be modular. For example, modifying a skin can only be done by changing the view layer, without having to manipulate the other two layers.
4, in fact, whether it is software development, or web framework, we also have a lot of things in life can be abstracted into the MVC pattern, such as time-out shelves, warehouses, and merchandise from warehouse to shelf rules, these three parts can be expressed with MVC.
More descriptions can be understood by reading the contents of the reference.
Reference
[1] Talk about the MVC pattern