First article what is MVC

Source: Internet
Author: User
Tags format definition silverlight

1. What is MVC.

MVC is not a programming language, not technically, but a "framework" for development. It is a development concept.

MVC divides the software development process into three main units: model, view (view), controller.

2. What is model

Models, also called data models, are responsible for all data-related tasks.

Include the following:

Defines the data structure.

Be responsible for communicating with database.

Reads data from the database.

Writes data to the database.

Run the stored procedure (what do you mean).

Data format validation.

Define and validate business logic rules.

The data are processed in various ways. For example, specify the default values for some fields of an entity.

In short, as long as the data-related tasks, should be in the model to complete the definition.

2. What is view

Translated into a view.

View is responsible for all the things presented in front of the user, the simple argument is the input and output. The output job is to render the page on the browser. such as output html/xml and so on. The input work is to transfer the data entered by the user back to the server.

The following is a brief introduction to the output of input-related work in view

Output:

(1) Obtain the data from the controller and display it on the user interface.

(2) Decide what technology to use to present "user interface" (such as Html/xml/silverlight/flash).

(3) responsible for the layout of the interface, font, color, aesthetics and various presentation methods.

(4) The data transmitted by the Controller is displayed in the interface, and the data is the definition of reference from model.

(5) Refer to the Model data format definition data display.

Input:

(1) responsible for sending data back to controller.

(2) HTML output data via get or post.

(3) The action that determines which controller the data should be sent to.

(4) Determine the way data is transmitted, such as get,post, etc.

(5) The basic data format verification of the preceding paragraph.

(6) Verification functions, such as using JS to verify that the form field is entered.

(7) referring to the category definition of model, using IntelliSense to write programs in VS, this is not very clear.

The technologies associated with view are as follows.

Html/xml/css/json/javascript/masterpage/ajax/silverlight/flash/mobile page/wap page/iphone Web page.

In short, all the logic that should be displayed on the page is the scope of view responsibility.

3. What is a controller

Can be translated into a controller, as the name implies is the control of the global object, and its responsibility for the following work:

(1) Decide which pipelines to communicate with the user, such as HTTP or HTTPS.

(2) Determine the process of system operation. For example, immediately after receiving data from the controller, turn to another page.

(3) Be responsible for obtaining data from model.

(4) The decision should show the view. There are many view in a website, it is the controller's responsibility to select the view display.

First article what is MVC

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.