- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
《Understanding MVC》.pdf
Understanding MVC: The Basics
October 8, 2009 — 18 Comments
This entry is part 1 of 3 in the series Understanding MVC
Understanding MVC
1. Understanding MVC: The Basics
2. Understanding MVC: Framework Conventions
3. Understanding MVC: Coding
I’m planning on writing several posts on the Yii framework (for PHP 5),
which I’ve been using for the past several months. Before getting into
that, though, I thought it’d be worth while to write about the
MVC—Model-View-Controller—architecture first. MVC (first defined 30
years ago!) has become a standard approach for frameworks and many other
types of application development, where the emphasis is on separating
presentation from logic. By taking this route, you can more easily tweak
individual parts without (hopefully) breaking the whole.
The basic concept is relatively simple to understand, but I found that
the actual implementation of the pattern can be tricky. In other words,
it can take some time to master where you put your actual code. In this
post, I write about the individual pieces and how the relate to each other.
In a follow-up post, I’ll write about how to communicate between them,
and what in the world $this means at any particular point!The MVC pattern
breaks an application into three distinct parts:
Model, which represents the data
View, which is the interface (i.e., how the user interacts with the
data)
Controller, which are the actions
I think the Model is easiest to comprehend as it’s the data being used
and manipulated. Models are often tied to database tables, where one
instance of a Model represents one row of data from one table. Note that
if you have two related tables, like employees and departments, those
would be represented by two separate Models, not one. You want to keep
your Models as atomic as possible. A less obvious, but still valid, use
of Models is for representing non-permanent pieces of data. For example,
if your site has
您可能关注的文档
- 《SYT 6390-二零一六 G.DAPS-4G.DAPS-4R地震数据采集系统检验项目及技术指标》.pdf
- 《SYT 6662-二零一六 石油天然气工业用钢架增强聚乙烯复合管》.pdf
- 《SYT10047-二零一六《海上油(气)田开发工程环境保护设计规范》》.pdf
- 《SY_4202-二零一六_石油天然气建设工程施工质量验收规范_储罐工程》.pdf
- 《SY/T_6423.1-1999_石油天然气工业承压钢管无损检测方法埋弧焊钢管焊缝缺欠的射线检测》.pdf
- 《SZDBZ 29.6-二零一六 电动汽车充电系统技术规范 第6部分:充电站监控管理系统》.pdf
- 《Tair存储系统在淘宝大规模应用实践》.pdf
- 《TB10115-1998 铁路工程岩石试验规程》.pdf
- 《TBT 3035-二零一六 列车通信网络》.pdf
- 《tcp3g02》.pdf
- 《UNIX&LINUX 平台可执行文件格式分析》.pdf
- 《unix_linux应用程序命名法》.pdf
- 《UNIX到+Linux应用移植的研究》.pdf
- 《Up! Mini 3D打印机全面评测:仅899美元在国内买不到的3D打印机》.pdf
- 《UPLC(ACQUITY 系统操作培训教程)》.pdf
- 《V1_二零一六0826_二零一六年金融学、经济学考研_国际贸易学讲义_郝延伟》.pdf
- 《vb6.0高清教程系列_第01章_Visual_Basic_6.0_概述(共九章)》.pdf
- 《VB基础教程 计算机等级考试二级教程》.pdf
- 《VC++图形图像处理源代码》.pdf
- 《VC++数据库编程》.pdf
文档评论(0)