[Declaration] If you need to copy, spread, please attach this statement, thank you. Original source: http://morningspace.51.net/ ,moyingzz@etang.com
As a model, MVC is commonly used in distributed applications (such as: large business websites, enterprise management systems, etc.), and identify organizational relationships between systems. But this analysis method is actually suitable for other areas. It does not contain unique properties in a particular field. The author believes that in terms of the essence of the MVC structure, it is a method of solving the problem of coupling system. In an interior of a system having coupling features, each component is associated with each other by a certain manner. When a part is changed, it affects the state of the peripheral portion by itself, and the state of the peripheral portion changes, and thereby affects the status of other parts by a similar association. This change will spread from the source terminal as a chain reaction, and the so-called "moving the whole body". In extreme cases, the system is isolated between each other, that is, there is no association, the phenomenon as described above will not occur. And usually, if the degree of coupling of the system is, that is, the closer relationship between the parts, the more obvious this effect. For a software, it belongs to a system with coupling characteristics, and the direct embodiment of the above phenomenon is the maintenance process of software. The closer the association between the software, the greater the difficulty of its maintenance. The method of solving this problem can be considered from two aspects. First, it should be made as much as possible to reduce the degree of correlation between the systems, which is obvious. Therefore, the system designer is required to clarify the responsibilities of each part of the system, and avoid functional intersections. This makes it possible to simplify the association between the parts (can be referred to as a system-level association), and some associations are hidden as the association inside each part (can be referred to as a module level association). From the system level, after such treatment, the system structure will be clearer, and the association will be relatively reduced. Second, on this basis, these associations can be concentrated, and the positions associated with each part are set as much as possible, rather than spreading all corners of the system. Thus, when the system changes, the system maintainer can find the location that needs to be modified faster. The advantage of this processing method is that the maintainer can focus on the changes inside the module during the system change, and the change of the relevant modules. At the same time, it reduces the work consumption consumed by the relationship between each part of the processing system and the work consumed to find these associations. In addition, many systems are not a simple two-layer structure (ie, system level and module level), which may be a multilayer structure in a tree form. Therefore, the above method can not only be used in the overall design, but also for local design. One module is regarded as a subsystem, the same processing is performed. If there is a sub-module in the module, a similar process is also performed. This is cycled until all parts of this "system tree" are traversed. The MVC structure reflects the above. This thinking method is worth reference. In fact, there are still many similar structures. Document / View Architecture and MVC in the MFC are similar, which is a structure ranked after the specific business processing is abstract. The idea is to divide the system into two clear parts, and the document is responsible for processing and maintenance, and regards as a user interface, responsible for implementing the performance of data, and accepting the feedback of the user and transmitting the document. The association between the documents and the views is partially contemplated by the system. It is often embodied by some fixed ways, which is often part of the most applications. Other associations need to be defined by the designer by the designer.