1

Yinuan' Blog

 2 years ago
source link: https://blog.yinaun.com/posts/57330.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

什么是MVC

发表于

2020-09-02 更新于 2020-11-20 分类于 Web

什么是MVC

这是一个和 web 应用相关的模式,不论是 java 开发(java 中的 web 框架采用就是这种模式),还是 python 开发。

M:Model ==> 与数据库相关的模型层

V:Views ==> 网页的地址,以及渲染网页等

C:Controller ==> 访问网页地址后,读取页面数据,调用业务逻辑

初学者可能会把这个理解为三层架构 但是,这俩完全不是一个东西

企业做开发时, 经常采用三层架构来分层 :表示层、业务层、持久层。 表示层负责接收用户请求、转发请求、显示数据等;业务层负责组织业务逻辑;持久层负责持久化业务对象。

每一层都有不同的模式, 这就是架构模式,其中 表示层采用的架构模式就是MVC

因此, MVC只是三层架构里的表示层的架构模式


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK