Sunday 27 September 2015

MVC vs Web forms


MVC vs Web forms

Below table explains about the difference between web application creating using Asp.Net MVC and Web Forms.
Asp.Net Web FormsAsp.Net MVC
It use old Event driven development model.If follows MVC (Model, View, Controller) pattern based development model
It uses Page controller pattern approach for rendering layout. In this approach, every page has its own controller, i.e., code-behind file that processes the request.It uses Front Controller approach. That approach means a common controller for all pages processes the requests.
Here each page has its own code behind file. So it is tightly integrated and usually require less code than the MVC modelLoosely coupled application development, where all the components are separated (Model, View and Controller).
No separation of concerns, applications is tightly coupledAll components are separated and it works purely on Separation of Concerns.
Unit testing the code behind file is very difficult because of tightly coupled code.Better support for test-driven development (TDD). It is one of main feature of MVC.
Uses view state or server-based forms to managing state information easierAsp.net MVC approach is a stateless, so there is no state management techniques.
WebForms model follows a Page Life cycle and it is complexRequest cycle for the MVC application is very simple
It has server controls, so developer need only less knowledge on HTML, JavaScript and CSSHere you need more knowledge on HTML, JavaScript and CSS. It has full control over HTML and it has HTML helpers
It follows file (web page) based URL. User has to specify the file name in the url to render the pageIt follows routed-based URL. User has to specify the controller and action name to render the view. Similar to REST based processing.
Web forms uses Master page for consistent look and feel in entire web applicationMVC uses Layout for consistent look and feel
It has User control for code re-usabilityIt has Partial Views for code re-usability
Works well for small teams of Web developers and designers who follows rapid application developmentWorks well for Web applications that are supported by large teams of developers and Web designers who need a high degree of control over the application behavior
It is not Open sourceIt is Open source

No comments:

Post a Comment