[Summary] recognize learning MVC

Reference links:

table of Contents:


First, what is MVC

1, the concept of

  • MVC full name is the Model View Controller, is a model (model) - view (view) - abbreviation controller (controller) of
  • A software design model, with a service logic, data, organization code interface display method of separating the business logic to gather a member which, while improving and customization interfaces and user interaction does not need to rewrite the business logic . MVC was developed a unique structure for a conventional mapping input, processing and output of the logic functions in a graphical user interface.

  • Summary: MVC is a framework similar to the three, the main idea or the use of packaging (stratification), and to reduce the degree of coupling, so that our system more flexible and more scalable.

2, content

      Model (model) is a portion for processing the application logic of the application data. Model objects are usually responsible for accessing data in the database.
      View (View) is a partial processing data applications. Usually view is created based on the model data.
      Controller (Controller) is a part of the application processing user interaction. Typically the controller is responsible for reading data from the view, a user input control, and the transmission data model

        Xiao Bian Emphasis:

          

3, the advantages

       (1) First of all, the most important point is that multiple views to share a model. It can be reused in different views of the same model, greatly improving the reusability of code.
       (2) Since the MVC three independent modules, wherein a change does not affect the other two, so that design can be constructed based on good loose coupling member.
       (3) In addition, the controller increases the flexibility and configurability of the application. The controller can be used to couple different models and views to complete the needs of users, so that the controller may provide a powerful tool for the configuration application.

4, shortcomings

       (1) increases the complexity of the system architecture and implementation.

          For simple interface, strictly follow the MVC, the model, view and controller separation, will increase the complexity of the structure, and may produce excessive update operations, reduce operating efficiency.
  (2) too tight connection between the view and the controller.

           View and the controller are separated from each other, but it does close contact member, the view of the absence of the controller, its application is very limited, and vice versa, thus obstructing their independence reuse.
  (3) view of the inefficient use of the model data access.

             Depending on the user interface of the model, the view might require multiple calls to get enough data to display. Unnecessary frequently accessed data is not changed, it will also hurt operating performance.
  (4) At the moment, the advanced interface tools or constructor does not support MVC architecture.

              The transformation of these tools to suit the needs and MVC establish separate cost component is high, resulting in difficulty of using the MVC

        Xiao Bian Emphasis: according to the advantages and disadvantages of MVC, we know that each thing has its own scope of application.

       For large-scale application development there is a lot of user interface, business logic and complex, MVC will make your software on robustness, code reuse and structure to a new level. It takes a certain amount of work to build MVC framework Although initially, but in the long run, it will greatly improve the efficiency of the latter part of software development.

        So when we apply specifically to consider its scope,

Second, the principle

END

Guess you like

Origin www.cnblogs.com/anliux/p/11429057.html