The advantages and disadvantages of MVC

Source: Internet
Author: User


1, the benefits of MVC

(1) can create and use multiple views at run time for a model. The change-propagation mechanism ensures that all related views are in time to get model data changes, so that all associated views and controllers behave in a synchronous manner. The

(2) view is pluggable with the controller, allowing the view and controller objects to be replaced, and the object can be switched on or off dynamically, even during run time, depending on the requirements. The portability of the

(3) model. Because the model is independent of the view, it is possible to migrate a model independently to the new platform work. All you need to do is make new changes to the view and controller on the new platform.

(4) A potential framework structure. The application framework can be built on this model, not just in the design of the interface.

2, the disadvantage of MVC

(1) increases the complexity of the system structure and implementation. For a simple interface, strict adherence to MVC, which separates the model, view, and controller, increases the complexity of the structure and may result in excessive update operations and reduced operational efficiency. An overly tight connection between the

(2) View and the controller. Views and controllers are separated from each other, but they do have a tight connection, the view has no controller, its application is very limited, and vice versa, which prevents them from being reused independently.

(3) View inefficient access to model data. Depending on the model operator interface, the view may need to be called multiple times to obtain sufficient display data. Unnecessary frequent access to unchanged data will also compromise operational performance.

(4) Currently, the MVC pattern is not supported for general advanced interface tools or constructors. The cost of transforming these tools to accommodate MVC needs and to build separate parts is high, resulting in the difficulty of using MVC.


Advantages:

1) View control model separation for improved code reuse.

2) Improve development efficiency.

3) Facilitates later maintenance and reduces maintenance costs.

4) facilitates the division of labor between multiple developers.

Cons:

1) A clear architecture at the expense of the complexity of the code may reduce development efficiency for small projects.

2) less efficient

3) There is no better solution for rich clients

4) The control layer and the presentation layer are sometimes too tight, resulting in no real separation and reuse of

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.