MVC 5 Features | Architecture | LifeCycle

MVC 5 Features | Architecture | LifeCycle

We will learn...
  • MVC Pattern What & Why
  • MVC Architecture Workflow & SoC
  • MVC Life Cycle
  • MVC Features (Advantages) and What’s New in MVC 5
  • When to Use MVC
Recommended Videos: 
MVC (What & Why)
  • The Model-View-Controller (MVC) architectural pattern separates/ decouple an application into three main groups of components: user-interface (View), data (Model), and application logic (Controller), for achieving a clean separation of concerns.
  • MVC is easier to code, debug, and test model, view and controller that has a single job. 
  • Supported on Windows, Linux, and macOS.
  • ASP.NET MVC is an alternative and a complement to Web Forms, which means you won’t be dealing with pages and controls, postbacks or view state, or complicated ASP.NET event life cycle.
  • ASP.NET MVC framework is a lightweight, highly testable presentation framework. It's more difficult to update, test, and debug code that has dependencies spread across two or more of these areas. For example, If presentation code and business logic are combined in a single object.
  • MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.

MVC Work Flow…
  • In MVC pattern, user requests are routed to a Controller which is responsible for working with the Model to perform user actions and/or retrieve results of queries. 
  • The Controller chooses the View to display to the user, and provides it with any Model data it requires.
  • The View renders the final page, based on the data in the Model.
  • Both the view and the controller depend on the model. However, the model depends on neither the view nor the controller. 
  • This is one of the key benefits of the separation. This separation allows the model to be built and tested independently of the visual presentation.
MVC (SoC)
  • Model Responsibilities - Strongly-typed views typically use ViewModel types designed to contain the data to display on that view. 
  • View Responsibilities - They use the Razor view engine to embed .NET code in HTML markup. There should be minimal logic within views, and logic should be relate to presenting content. 
  • Controller Responsibilities - Controls how the app responds to a given request.
MVC Common Features
  • Filters, Areas, Routing, Model binding and Validation
  • SoC, REST SEO, Testability (TDD)
  • Extensible and Pluggable
  • Dependency Injection 
  • Razor view engine
  • Strongly typed views 
  • Tag Helpers
MVC 5 Features (VS2013 with .Net 4.5 – Initial OCT 2013)
  • Bootstrap in the MVC template  - The default template of MVC5 gives you Home, Contact, and About pages. Depending on the size of your browser window, you might need to click the navigation icon to see ALL option.
  • One Asp.Net -(WebForm/MVC/API/SignalR & UnitTest).
  • ASP.Net Identity -(3rd Party authentication-OAuth 2.0).
  • Attribute Based Routing
  • ASP.NET Scaffolding -Code first approach for operation.
  • Filter Overrides -Change specific filters types from the global filter or control level filter.
  • Authentication filters - run prior to authorization filters in the ASP.NET MVC pipeline
  • ASP.NET Web API2


When to use MVC application
  • You must think carefully whether to implement a Web application by using either the ASP.NET MVC framework or the ASP.NET Web Forms model. 
  • The MVC framework does not replace the Web Forms model. 
  • Before you decide to use the MVC framework or the Web Forms model for a specific Web site, weigh the advantages of MVC over WebForm.
Next : Create ASP.NET MVC 5 Application

No comments:

Post a Comment

Your feedback is important.
Visit www.techwebdots.in