Más contenido relacionado
La actualidad más candente
La actualidad más candente (20)
Similar a ASP.NET MVC Under the Hood: Controller Factories, Action Invokers, Model Binders and More
Similar a ASP.NET MVC Under the Hood: Controller Factories, Action Invokers, Model Binders and More (20)
ASP.NET MVC Under the Hood: Controller Factories, Action Invokers, Model Binders and More
- 2. Agenda ASP.NET MVC 101 ASP.NET MVC Pipeline Controller Factories Action Invokers Model Binders Action Filters Action Results View Engines
- 6. ASP.NET Request Pipeline Module Module Module Handler public interface IHttpHandler { void ProcessRequest( HttpContext context); boolIsReusable { get; } } Handler Internet Handler Handler Handler
- 7. Web Forms <%@ Page Language="C#" CodeBehind="Default.aspx.cs" Inherits="Sample.DefaultPage" %> <div> <asp:TextBoxrunat="server" /> </div> PreInit Init InitComplete PreLoad Load Control Events LoadComplete PreRender SaveStateComplete Render Unload namespace ASP { public class default_aspx : Sample.DefaultPage, System.Web.IHttpHandler {
- 8. MVC Pipeline Internet Module Module Controller Factory Routing Controller.Execute() MvcHandler Action Invoker View Engine
- 9. MVC Pipeline: Controller Factories public interface IControllerFactory { IControllerCreateController( RequestContextrequestContext, string controllerName); void ReleaseController( IController controller); }
- 10. MVC Pipeline: Controllers public interface IController { void Execute( RequestContextrequestContext); } Controller IActionInvoker
- 11. MVC Pipeline: Action Invoker public interface IActionInvoker { boolInvokeAction( ControllerContextcontrollerContext, string actionName); }
- 12. MVC Pipeline: Action Invoker Action Invoker Find Action Authorization Filters Request Validation Model Binders Pre-Action Filters Invoke Post-Action Filters Execute Action Result
- 13. MVC Pipeline: Model Binders public interface IModelBinder { object BindModel( ControllerContextcontrollerContext, ModelBindingContextbindingContext); }
- 14. MVC Pipeline: Action Filters public interface IActionFilter { void OnActionExecuting( ActionExecutingContextfilterContext); void OnActionExecuted( ActionExecutedContextfilterContext); }
- 15. MVC Pipeline: Action Results public abstract class ActionResult { public abstract void ExecuteResult( ControllerContext context); } ViewResultBase RedirectResult JsonResult FileResult ViewResult PartialViewResult
- 16. MVC Pipeline: View Engines public interface IViewEngine { ViewEngineResultFindPartialView( ControllerContextcontrollerContext, string partialViewName, booluseCache); ViewEngineResultFindView( ControllerContextcontrollerContext, string viewName, string masterName, booluseCache); void ReleaseView( ControllerContextcontrollerContext, IView view); }