Django processes and patterns

Django process

Django framework mode

MVC is the well-known pattern, namely: the application into three components: Model (model), View (View), and a Controller (Controller). Effects: reduce the coupling between modules (decoupled). Wherein:
      M-- state management applications (typically stored in the database, the database encapsulation layer), and constrain the behavior of a change of state (or the "business rules").
      C-- receives an external operation by the user, according to the operation to obtain data access model, and calls the "View" display the data. The controller is the "model" and "View" isolation and become a link between the two.
      After V-- responsible for formatting the data presented to the user.

FIG MCV mode:

Django is a MVC framework. However, in Django, the controller accepts user input portion discretion of the frame, so there is more concerned Django model (Model), the template (Template) and view (the Views), known as MTV mode:

    M Representative model (Model) , i.e., the data access layer. The layer of all transactions and data related to: how to access, how to verify the validity of the relationship between behavior and what data is contained and so on.

    T represents the template (Template), ie, the presentation layer. This layer processing and performance-related decisions: how to display the page or other types of documents.

    V represents a view (View), i.e., the business logic layer. The access layer includes associated logic model and retrieval of appropriate templates. You can think of it as a bridge between the model and template.

FIG MTV mode:

 

Guess you like

Origin www.cnblogs.com/maplethefox/p/11233805.html