Groups
Groups
Sign in
Groups
Groups
词点
Conversations
About
Send feedback
Help
MVC
1 view
Skip to first unread message
TangGaowei
unread,
Jun 12, 2006, 8:16:15 PM
6/12/06
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cid...@googlegroups.com
MVC——模型-视图-控制器。
模型
表示应用的问题域,也就是要解决的问题。一个文字处理应用需要为文档建模;一个地图应用需要为点、栅格、等高线等建模。
视图
是程序展现给用户的东西,例如输入表单、图片、文本或者UI组件。视图不一定是图形形式的。例如,在一个声音驱动的程序中,主意提示也是视图。
MVC的黄金定律是视图和模型不应该相互通信。表面上看,这个要求似乎会导致程序的功能不全,但是这正是
控制器
的作用之所在。当用户按下一个按钮或者填写一个表单时,视图会通知控制器。控制器操作模型并用决定模型上的变化是否需要改变视图。如果需要,它就通知视图更新它自己。
——《Ajax实战》
Reply all
Reply to author
Forward
0 new messages