Traditional Culture Encyclopedia - Traditional stories - What are the advantages and disadvantages of MVC pattern?
What are the advantages and disadvantages of MVC pattern?
Advantages:
1. Do their job and do not interfere with each other.
In MVC mode, the three layers perform their respective functions, so if the requirements of any layer change, only the code of the corresponding layer needs to be changed without affecting the code of other layers.
2. Conducive to the developing division of labor.
In MVC mode, because the system is hierarchical, it can better realize the division of labor in development. Web designers can develop JSP in the view layer, developers who are familiar with business can develop the business layer, and other developers can develop the control layer.
3. Conducive to the reuse of components
Layering is more conducive to the reuse of components. If the control layer can be an independent component, the view layer can also be made into a general operation interface.
4.MVC design pattern can be said to realize hierarchical development. Each layer has its own function.
5. The dependence between layers is reduced, which is beneficial to the standardized development of codes.
6. When replacing with new code business logic, we only need to replace the corresponding layer, which greatly reduces our workload and has a clear division of labor.
Disadvantages:
1. increases the complexity of system structure and implementation. For a simple interface, strictly following MVC and separating model, view and controller will increase the complexity of the structure, and may produce too many updating operations and reduce the running efficiency.
2. The connection between the view and the controller is too tight. View and controller are separated from each other, but they are closely related. Without the controller, the application of views is very limited, and vice versa, which hinders their independent reuse.
3. Inefficient access of views to model data. Depending on the operation interface of the model, it may be necessary to call the view several times to get enough display data. Unnecessary frequent access to unchanged data can also damage operational performance.
4. At present, the general advanced interface tools or constructors do not support MVC pattern. It is very expensive to transform these tools to meet the needs of MVC and build separate components, which makes MVC difficult to use.
5. Trouble, some codes are too repetitive to be used in actual development, so you should learn the framework. The bird's eye view below analyzes which layers the framework has replaced in MVC.
MVC is mainly a design pattern in java development;
M:model (model, mainly the service business logic layer and the Dao layer that connects the database and sends data).
V: view (view, that is, the user's interface, usually called foreground page, jsp, etc. )
C: Controller (the control layer can be regarded as a relay, it receives the request of the foreground user and calls the service, dao sends the data to the background, and the background returns the data to the controller after database operation and business logic analysis, and finally returns to the foreground jsp page).
- Related articles
- Method for making dried red dates
- Thirteen gongfu video with mnemonic
- What are the traditional Chinese figures?
- She is the first female player from China in WWE. Now she has developed a whole set of muscles, and thigh tattoos are even more stealing the camera. Who is she?
- 50 KFC Fast Food English Terms
- What small and medium-sized catering enterprises are there?
- Stories about Chongyang Festival allusion
- What are the advantages of network interpersonal communication compared with traditional interpersonal communication?
- The traditional architecture in southern Yunnan, China is
- What is the regulatory process? What are the common regulatory issues?