Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
ASP.NET MVC Under the Hood<br />Paul Stovell<br />Readify<br />
Agenda<br />ASP.NET MVC 101<br />ASP.NET MVC Pipeline<br />Controller Factories<br />Action Invokers<br />Model Binders<br...
Introducing ASP.NET MVC<br />
GET /<br />View<br />Controller<br />Model<br />
ASP.NET MVC Pipeline<br />
ASP.NET Request Pipeline<br />Module<br />Module<br />Module<br />Handler<br />public interface IHttpHandler<br />{<br /> ...
Web Forms<br />&lt;%@ Page Language=&quot;C#&quot; <br />    CodeBehind=&quot;Default.aspx.cs&quot; <br />    Inherits=&qu...
MVC Pipeline<br />Internet<br />Module<br />Module<br />Controller Factory<br />Routing<br />Controller.Execute()<br />Mvc...
MVC Pipeline: Controller Factories<br />public interface IControllerFactory<br />{ <br />IControllerCreateController(<br /...
MVC Pipeline: Controllers<br />public interface IController<br />{<br />    void Execute(<br />RequestContextrequestContex...
MVC Pipeline: Action Invoker<br />public interface IActionInvoker<br />{<br />boolInvokeAction(<br />ControllerContextcont...
MVC Pipeline: Action Invoker<br />Action Invoker<br />Find Action<br />Authorization Filters<br />Request Validation<br />...
MVC Pipeline: Model Binders<br />public interface IModelBinder<br />{<br />    object BindModel(<br />ControllerContextcon...
MVC Pipeline: Action Filters<br />public interface IActionFilter<br />{<br />    void OnActionExecuting(<br />ActionExecut...
MVC Pipeline: Action Results<br />public abstract class ActionResult<br />{<br />    public abstract void ExecuteResult(<b...
MVC Pipeline: View Engines<br />public interface IViewEngine<br />{<br />ViewEngineResultFindPartialView(<br />ControllerC...
Summary<br />
Q&A<br />www.asp.net/mvc<br />http://www.mokosh.co.uk/page/VsCommands.aspx<br />Paul Stovell<br />paul.stovell@readify.net...
Upcoming SlideShare
Loading in …5
×

ASP.NET MVC

4,252 views

Published on

Published in: Technology
  • Be the first to comment

ASP.NET MVC

  1. 1. ASP.NET MVC Under the Hood<br />Paul Stovell<br />Readify<br />
  2. 2. Agenda<br />ASP.NET MVC 101<br />ASP.NET MVC Pipeline<br />Controller Factories<br />Action Invokers<br />Model Binders<br />Action Filters<br />Action Results<br />View Engines<br />
  3. 3. Introducing ASP.NET MVC<br />
  4. 4. GET /<br />View<br />Controller<br />Model<br />
  5. 5. ASP.NET MVC Pipeline<br />
  6. 6. ASP.NET Request Pipeline<br />Module<br />Module<br />Module<br />Handler<br />public interface IHttpHandler<br />{<br /> void ProcessRequest(<br />HttpContext context);<br />boolIsReusable { get; }<br />}<br />Handler<br />Internet<br />Handler<br />Handler<br />Handler<br />
  7. 7. Web Forms<br />&lt;%@ Page Language=&quot;C#&quot; <br /> CodeBehind=&quot;Default.aspx.cs&quot; <br /> Inherits=&quot;Sample.DefaultPage&quot; <br /> %&gt;<br />&lt;div&gt;<br /> &lt;asp:TextBoxrunat=&quot;server&quot; /&gt;<br />&lt;/div&gt;<br />PreInit<br />Init<br />InitComplete<br />PreLoad<br />Load<br />Control Events<br />LoadComplete<br />PreRender<br />SaveStateComplete<br />Render<br />Unload<br />namespace ASP {<br /> public class default_aspx<br /> : Sample.DefaultPage, <br />System.Web.IHttpHandler<br /> {<br />
  8. 8. MVC Pipeline<br />Internet<br />Module<br />Module<br />Controller Factory<br />Routing<br />Controller.Execute()<br />MvcHandler<br />Action Invoker<br />View Engine<br />
  9. 9. MVC Pipeline: Controller Factories<br />public interface IControllerFactory<br />{ <br />IControllerCreateController(<br />RequestContextrequestContext, <br /> string controllerName); <br /> void ReleaseController(<br />IController controller); <br />} <br />
  10. 10. MVC Pipeline: Controllers<br />public interface IController<br />{<br /> void Execute(<br />RequestContextrequestContext);<br />}<br />Controller<br />IActionInvoker<br />
  11. 11. MVC Pipeline: Action Invoker<br />public interface IActionInvoker<br />{<br />boolInvokeAction(<br />ControllerContextcontrollerContext, <br /> string actionName);<br />}<br />
  12. 12. MVC Pipeline: Action Invoker<br />Action Invoker<br />Find Action<br />Authorization Filters<br />Request Validation<br />Model Binders<br />Pre-Action Filters<br />Invoke<br />Post-Action Filters<br />Execute Action Result<br />
  13. 13. MVC Pipeline: Model Binders<br />public interface IModelBinder<br />{<br /> object BindModel(<br />ControllerContextcontrollerContext, <br />ModelBindingContextbindingContext);<br />}<br />
  14. 14. MVC Pipeline: Action Filters<br />public interface IActionFilter<br />{<br /> void OnActionExecuting(<br />ActionExecutingContextfilterContext);<br /> void OnActionExecuted(<br />ActionExecutedContextfilterContext);<br />}<br />
  15. 15. MVC Pipeline: Action Results<br />public abstract class ActionResult<br />{<br /> public abstract void ExecuteResult(<br />ControllerContext context);<br />}<br />ViewResultBase<br />RedirectResult<br />JsonResult<br />FileResult<br />ViewResult<br />PartialViewResult<br />
  16. 16. MVC Pipeline: View Engines<br />public interface IViewEngine<br />{<br />ViewEngineResultFindPartialView(<br />ControllerContextcontrollerContext, <br /> string partialViewName, <br />booluseCache);<br />ViewEngineResultFindView(<br />ControllerContextcontrollerContext, <br /> string viewName, <br /> string masterName, <br />booluseCache);<br /> void ReleaseView(<br />ControllerContextcontrollerContext, <br />IView view);<br />}<br />
  17. 17. Summary<br />
  18. 18. Q&A<br />www.asp.net/mvc<br />http://www.mokosh.co.uk/page/VsCommands.aspx<br />Paul Stovell<br />paul.stovell@readify.net<br />www.paulstovell.com<br />

×