Even after the evolution of the revolutionary features of ASP.NET,
It was still not able to solve the problems of unit testing
I never saw any ASP.NET Web Form developer who tries to disable the ViewState. (It’s my perspective, no hard feelings please.)
We got some control over ID of elements, but not complete control over HTML, still have problem to implement JavaScript.
What is MVC?
MVC is an architectural pattern which is has been around for sometimes now.
Many are using it including Java. It’s not new concept which Microsoft brought it up. ASP.NET MVC is something we should talk about. But prior to that lets clear some terminologies including MVC.
Patterns - In simple words Pattern is a solution to a problem in a context.
Architectural Patterns - Architectural Pattern is something which solves our problem at sub system level or in short module level. It deals with the problem related to architecture of a project. It tells us how we can divide our systems and especially why. We make Class libraries, Components, Web services to solve the problem.
MVC When we talk about application we will be having input logic, business logic and UI logic and MVC is an architectural pattern which let us develop an application having loosely coupling between each of these elements.
The main intention behind MVC pattern is separation of concerns. It makes presentation or UI ignorant of business and user interaction logic.
According to MVC system should be divided as M (Model), V (View) and C (Controller).
Model is considered as smart and handles the Business rules, logic and data and will be independent of other parts of MVC (controller and View).
Controller receives and dispatches the request in short it handles the user interaction and input logic. It knows about both Model and View.
A view is considered as dumb and is an output representation of model data. It may be an excel sheet, a web page showing list of records or just a simple text. View knows about only Model.
What is ASP.NET MVC?
ASP.NET MVC is a Microsoft’s one more Web application framework designed with separation of concerns and testability in mind. It is built on CLR and completely based on MVC architecture and so we think in terms of controllers and Views. ASP.NET doesn’t have support for ViewState and server controls, so we get feel of old web here. Let’s talk about Advantages and disadvantages of ASP.NET MVC
Advantages:
Project architecture -
One of the advantages of using ASP.NET MVC is it enforces separation of concerns. So there is very less chances of getting things more complex.
Test Driven development and Reusability –
In MVC controller is a separate class so automatic testing is possible featuring Test Driven Development.
Controllers are not bound to any specific view and so can be reused for multiple views.
Performance - ASP.NET MVC don’t have support for view state, so there will not be any automatic state management which reduces the page size and so gain the performance.
WebForms vs. MVC
Start from the beginning
