Thursday, January 12, 2012

MVC Framework and Application structure

ASP.NET MVC is an open source web application framework. MVC uses the ASP.NET routing engine, which provides flexibility for mapping URLs to controller classes. 

MVC does not use ASP.NET Web forms post-back model for interactions with the server. Instead, all end-user interactions are routed to a controller class. It Maintains separation between UI logic and business logic and helps testability. As a result, ASP.NET view state and ASP.NET web forms page life-cycle events are not integrated 

With MVC based views. Routes are initialized in the Application_Start method of Global.asax file


from MSDN
    Global.asax file
    • Also known as ASP.NET application file. This file is optional
    • Resides in the root directory
    • Derived from HttpApplication class

    HttpApplicationState (implements NameObjectCollectionBase)

    You can use HttpApplicationState to share global information across multiple sessions and requests. 

    A Single instance of an HttpApplicationState class is created first time a client requests any URL resource within a particular ASP.NET application virtual directory. A separate single instance is created for each ASP.NET application on Web server. Reference to each instance is then exposed via the Application object. 

    You can access this via HttpContext.Application property. (In MVC 3 like this). You can use this to store application data that does not change typically. But sometimes it is better not to use this in case you want to access data outside the ASP.NET request pipeline (see this). 

    Application state is not shared across either a Web farm or a Web garden


    Future of ASP.NET 

    In the latter versions of ASP.NET, ASP.NET MVC, ASP.NET Web API and ASP.NET Web Pages will merge into a unified MVC 6. This is also known as ASP.NET vNext. 


    Resources

    1 comment:

    Powered by Blogger.


    Software Architect at Surge Global/ Certified Scrum Master

    Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

    Search This Blog

    Facebook