Code Monkey home page Code Monkey logo

Comments (1)

MMmaXingXing avatar MMmaXingXing commented on June 22, 2024

MVC

概念

Model View Controller, 是模型-视图-控制器的缩写,一种软件设计典范,用一种业务逻辑、数据、界面显示分离的方式组织代码,将业务聚集在一个部件中,在改进个性化定制界面中以及用户交互的同时,不需要重新编写业务逻辑。

MVC发展起来被用于映射传统的输入、处理、输出功能在一个逻辑的图形化用户界面的结构中。

其中,控制器Controller 是应用程序中处理用户交互的部分,通常负责从视图读取数据,控制用户输入。

MVVM

概念

MVVM是Model-View-ViewModel的缩写,本质上是MVC解构的改进版。MVVM就是将其中View的状态和行为抽象化,让我们将视图UI和业务逻辑分开。ViewModel可以取出Model中的数据同时帮忙处理View中由于需要展示内容而设涉及的业务逻辑。

其中:由于VM的出现,很大程度上减轻了controller的体积,VM负责处理整理好的数据, controller直接管理VM 而不再对原始数据进行管理并处理。

  • 在前端MVVM,直接指代数据双向绑定,而MVC仅仅是一种架构模式。

from daily.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.