The difference between the MVC model and the MVC framework

Source: Internet
Author: User
Tags html form php language

There are too many new names in spring! Ioc/di/mvc/aop/dao/orm ...

I was really dizzy for the first touch with spring! But once you have mastered a concept, it will serve you with all your might. This is more loyal than a woman.

Here, let's chat about MVC! Well! The difference between the MVC design model and the MVC framework.

A set of concepts need to be understood first, as they need to be followed by:

Architecture: A simple architecture is a blueprint, a design that abstracts the different requirements of a customer into an abstract component, and describes the communication and invocation between these abstract components.

Framework: Software framework is an architecture that extracts the common parts of specific domain software during project software development, and the software projects in different fields have different framework types. The framework is not a ready-to-use application system. It is a semi-finished product that provides a number of services that developers have developed two times to implement specific functions of the application system.

Design pattern: is a set of repeated use, most people know, after the purpose of classification, code design experience Summary, it emphasizes a design problem solving method.

first of all, the MVC design Model :

1. Definition: TheMVC design Model is a pattern of creating a WEB application using the Model View controller (models-view-controller) design.

It is easy to see that the MVC model is a style used to write Web applications, meaning that only the Web cannot be written.

2. Now that you have used the Model view controller (models-view-Controller), then it is necessary to introduce the (model-view-Controller) What exactly is a thing?

Model: Is the part of the application that handles application data logic . Typically, model objects are responsible for accessing data in the database .

View : Is the part of the application that handles the display of data .
typically views are created from model data .

Controller: Is the part of the application that handles user interaction .
usually the controller is responsible for reading data from the view, controlling user input, and sending data to the model . again, the MVC framework :The 1.MVC framework, which makes it mandatory to separate application input, processing, and output. Using an MVC application is divided into three core parts: model, view, controller. Each of them handles their own tasks. from the above, to use the MVC framework, you must abide by the framework of the rules, it has its mandatory location. A smart reader knows that the three core components it uses are actually from the MVC model. It is only in the framework that they are more independent of each other to deal with their respective tasks. 2. The most typical MVC is the JSP + servlet + JavaBean pattern. 3. View: A view is an interface that the user sees and interacts with . Views are primarily HTML-elements, Adobe flash,xhtml,xml/xsl,wml, and some other identity languages and Web services.

Model: models represent enterprise data and business rules .

Controller: Control The controller accepts the user's input and invokes the model and view to complete the user's needs, so when you click a hyperlink in a Web page and send an HTML form, the controllers themselves do not output anything and do any processing. It simply receives the request and decides which model component is called to process the request, and then determines which view to use to display the returned data. the difference between a design model and a framework: (note that the general concept is discussed here first!) )

First look at the differences on the Internet, from the Baidu Encyclopedia:

There are three levels of reuse in software production: internal reuse (that is, abstract blocks that can be used publicly in the same application), code reuse (combining common modules into libraries or toolsets for use in multiple applications and domains), application framework reuse (i.e. providing a common or off-the-shelf infrastructure for specialized areas For the highest level of reusability).

Frameworks are often code reuse, whereas design patterns are reuse (? How does design reuse come about? There is no definition of the top and bottom, the encyclopedia rubbish is here. ), the schema is somewhere in between.

The design pattern is a description of the recurring problems in an environment and the solution to the problem, which is more abstract than the framework, the framework can be expressed in code, can be directly executed or reused, and only instances of the schema can be represented in code; Design patterns are smaller elements than frames. A framework often contains one or more design patterns, and the framework is always targeted at a particular application area, but the same pattern can be applied to a variety of applications. It can be said that the framework is software, while design patterns are software knowledge.

The Wikipedia answer is often lack of rigor, I see in the MBR Lib website they classify software reuse as: Product reuse/knowledge reuse/environment reuse .

Frameworks are code reuse, so we always introduce a lot of packages when we use frames.

The framework is software, and the design pattern is the "knowledge" of the software. So patterns are the foundation of the framework.

then go back to the little concept of MVC:

Based on the large concept of framework and design patterns, we should be able to understand the MVC framework and the MVC design pattern difference of one or two.

In my understanding, the MVC design pattern is more like a designer's drawing (something on the drawing is often more abstract), and the MVC framework is more like an engineer's product built with the designer's drawings!

The final product may be more than the original blueprint of the designer, some features have been enhanced, some will be appropriately weakened, so as to more adapt to the needs of the public and experience! But in the whole and essentially follow the architect's construction.

MVC design pattern is like building a House Foundation (Foundation design + Structural design + strong and weak electrical design + fire design +etc), and the MVC framework can be built on this basis according to the needs of the beautiful finished room.

common frameworks and design models (note that this is a big concept)

What are the design patterns?

MVC, MTV, MVP, CBD, ORM and so on;

what are the frameworks?

the C + + language qt, MFC, GTK

the Java language of SSH, SSI PHP language Smarty (MVC mode) the Python language of Django (MTV mode) and so on;

Reference: Frame + architecture + design mode;

The difference between the MVC model and the MVC framework

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.