博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MVC模式
阅读量:4347 次
发布时间:2019-06-07

本文共 740 字,大约阅读时间需要 2 分钟。

Each piece of the MVC architecture is well defined and self-contained, which is referred to as the

separation of concerns. The logic that manipulates the data in the model is contained only in the model,
the logic that displays data is only in the view, and the code that handles user requests and input is
contained only in the controller. With a clear division between each of the pieces, your application will
be easier to maintain and extend over its lifetime, no matter how large it becomes.

 

简单来说,就是MVC的每一层都是定义明确而且是自包含,业务逻辑数据应当而且只能在Model层,显示逻辑应当而且只能在View层,处理用户请求和输入的应当而且只能在Controller层。

 

自己之前总是混淆了Model层和Controller层,把Model层当成了单纯的数据类,而把处理业务逻辑都放到了Controller层,现在总算是明白了

转载于:https://www.cnblogs.com/Junelee1211/archive/2012/05/18/2507196.html

你可能感兴趣的文章
NetWaiting 完美卸载方法
查看>>
必做作业2:视频剪辑软件调研
查看>>
[学习笔记]Javascript的包装对象
查看>>
第三次作业 个人统计分析报告
查看>>
ajax传参里含有特殊字符的坑
查看>>
python3.5 字典遍历
查看>>
proxy跨域
查看>>
走出迷宫
查看>>
月饼_5
查看>>
镜像二叉树
查看>>
2. LNMP安装了哪些软件
查看>>
C. 交叉连接(cross join)
查看>>
POJ3267
查看>>
POJ 1661 Help Jimmy (dijkstra,最短路)
查看>>
Java 线程实例 刷碗烧水和倒计时
查看>>
转载 - 微妙的圆角参数 纯CSS圆角Tab
查看>>
Python - 升级所有已安装的第三方包
查看>>
Caliburn.Micro 应用系列(一)
查看>>
iOS中copy和strong修饰变量的区别
查看>>
IRP的同步
查看>>