subject:
Is Mvc Really A Advantageus Move Forward
[print this page] Right now there are a whole lot of ASP.NET web forms coders out there who confess that they simply don't comprehend ASP.NET MVC. In a lot of ways, I can relate with them. The vocal fraction that tells you about ASP.NET MVC speak about it with such enthusiasm that they make it sound like you'd have to be a twit not to move over. In reality, the verdict isn't nearly as easy.
ASP.NET web forms aren't going anywhere. These strategies have their right place in a web developer's toolbox and it's essential to discover their strong points and disadvantages. In general, the ASP.NET MVC framework is likely to sacrifice ease-of-use (e.g. viewstate, validation, etc.) in order to give developers stronger control over the reins. This can be a terrific thing, but only if you take advantage of it. Or else it can just as readily be a issue.
With all of this, I have produced a swift metric to determine if ASP.NET MVC is right for you. The way I see it, there are a few primary factors a developer should decide on the ASP.NET MVC framework over ASP.NET web forms. If none of these factors are convincing to you, then you will need to stick with ASP.NET web forms:
To Obtain Control and Extensibility
As pointed out in the remarks, ASP.NET MVC allows you more control and extensibility options than ASP.NET web forms. You get complete control over the site request lifecycle and the capability to substitute out several key portions of the framework (e.g. view engine, routing, etc.), none of which is feasible with ASP.NET web forms.
In addition to this, you also get entire management over the delivered HTML. In general, the rendered HTML from ASP.NET web forms programs is dreadful. The web controls it takes advantage of build garbage ids and disguised . fields galore that not only limit the performance of a site, but also make CSS style and Javascript development a pain. ASP.NET MVC causes you to be much more in tune with your HTML. There aren't any datagrids or repeaters that like magic create markup for you. There aren't any invisible fields to continue to persist state for you. It's just you, the HTML, and a number of extension procedures.
To Unit Test
This, in my opinion, is the most engaging factor to use ASP.NET MVC. When it comes to unit testing, ASP.NET MVC basically surpasses ASP.NET web forms. It's not even close. Whereas ASP.NET web forms needs you to jump through all forms of hoops to test around the web page event lifecycle, the ASP.NET MVC framework basically begs to be tested. There are interfaces almost everywhere proclaiming "mock me up!".
There's a good reason why the major ASP.NET MVC followers also tend to be TDD supporters; it's simply because ASP.NET MVC actually allows for TDD. Professionally, I believe this is where all the passion comes from. Basically put: it's really hard to do TDD with ASP.NET web forms and genuinely very easy to do it in ASP.NET MVC.
To Look at Something Different
I should discuss that mastering ASP.NET MVC is an unbelievably engaging process since the ASP.NET MVC framework staff has been so interactive in the process. I consider a substantial part of the lure of ASP.NET MVC is that the community's knowledge is not only being taken into consideration, it is positively being sought after. The framework has sparked so many posts and arguments over best practices that just following along presents you to aspects you might until now have been ignorant of. I would actually advise understanding the ASP.NET MVC framework for this purpose alone.
So there it is. Apart from these three, I can't think of any other reasons why a developer would study ASP.NET MVC. It's possible this is why the adoption rate isn't nearly as high as we believe it should be. The motivator for using the framework fundamentally comes down to unit testing, control/extensibility, and feeling of boredom/curiosity. Fine reasons, but almost never game breakers for the vast greater part of developers out there.