惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
雷峰网
雷峰网
V
Visual Studio Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
IT之家
IT之家
Engineering at Meta
Engineering at Meta
Microsoft Security Blog
Microsoft Security Blog
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
月光博客
月光博客
A
About on SuperTechFans
B
Blog RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The GitHub Blog
The GitHub Blog
N
Netflix TechBlog - Medium
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale

博客园 - 柠茶

asp.net webapi 参数绑定总结 asp.net webapi 参数绑定总结 javascript引用类型 javascript变量,作用域和内存问题 javascript基本概念 javascript中所谓的“坑”收录 JS调用webservice的两种方式 反射体验(转) 什么是Emit,什么是反射,二者区别到底是什么?(转) 关于可空类型 学习IIS & MVC的运行原理 (转) MVC-READ5(asp.net web from PK asp.net MVC) MVC-READ4 MVC-READ3(视图引擎主要类关系图) MVC-READ2 @@ERROR和@@ROWCOUNT的用法 异常以及异常处理框架探析(转) .Net深入学习序列化和反序列化 (转) 可扩展对象模式(转)
MVC-READ1
柠茶 · 2014-01-17 · via 博客园 - 柠茶
  1. 将具有不同稳定性的元素融为一体,具有最差稳定性的元素决定了整体的稳定性,这是“短板理论”在软件设计中的体现.
  2. MVC的创建者是Trygve M. H. Reenskau,他是挪威的计算机专家,同时也是奥斯陆大学的名誉教授。MVC是他在1979年访问施乐帕克研究中心(Xerox PARC,Xerox Palo Alto Research Center)期间是提出一种主要针对GUI应用的软件架构模式。MVC最初用于SmallTalk,Trygve最初对MVC的描述记录在《Applications Programming in Smalltalk-80(TM):
  3. Model:是对应用状态和业务功能的封装,可以看成是同时包含数据和行为的领域模型(Domain Model)。Model接受Controller的请求执行相应的业务功能,并在状态改变的时候通知View
  4. View:实现可视化界面的呈现,捕捉最终用户的交互操作(比如鼠标和键盘操作)。
  5. Controller:View捕获到用户交互操作后会直接转发给Controller,后者完成相应的UI逻辑。如果需要涉及业务功能的调用,Controller会直接调用Model。在完成UI处理之后,Controller会根据需要控制原View或者创建新的View对用户交互操作予以响应
  6. Controller的激活

    string controllerName = this.RequestContext.RouteData.Controller;

    IControllerFactory controllerFactory = ControllerBuilder.Current.GetControllerFactory();

    IController controller = controllerFactory.CreateController(this.RequestContext, controllerName);

    controller.Execute(this.RequestContext);

   7   Action的激活

    string actionName = requestContext.RouteData.ActionName;

    ControllerContext context = new ControllerContext { RequestContext = requestContext, Controller = this };

    this.ActionInvoker.InvokeAction(context, actionName);

  8   MVC扩展点

    UrlRoutingModule----路由解析扩展

    IRouteHandler-------路由处理程序扩展

    IControllerFactory-----控制器的创建扩展

    IActionInvoker-----Action执行扩展

    IModelBinder-----Action参数绑定扩展

    ActionResult-----Action返回结果扩展