Using MODEL VIEW Controller (MVC) in Dot Net, What to Loose

Posted on Posted in Web and Software Development
Facebooktwittergoogle_plusredditpinterestlinkedinmail

At this time there are a good deal of ASP.NET web forms coders out there who admit that they simply don’t have an understanding of ASP.NET MVC. In a lot of ways, I can associate with them. The expressive fraction that talks about ASP.NET MVC speak about it with such fervour that they make it appear like you’d have to be a idiot not to change over. In reality, the selection isn’t nearly as straight forward.

ASP.NET web forms aren’t going anywhere. These methods have their right place in a web developer’s toolbox and it’s crucial to discover their strengths and flaws. In general, the ASP.NET MVC framework has a tendency to give up ease-of-use (e.g. viewstate, validation, etc.) in order to supply developers stronger control over the reins. This can be a terrific thing, but only if you take advantage of it. If not it can just as easily be a issue.

With all of this, I have developed a swift metric to establish if ASP.NET MVC is right for you. The way I see it, there are three primary purposes a developer should select the ASP.NET MVC framework over ASP.NET web forms. If none of these factors are compelling to you, then you need to stick with ASP.NET web forms:

To Increase Control and Extensibility

As indicated out in the commentary, ASP.NET MVC supplies you much more control and extensibility options than ASP.NET web forms. You get entire control over the page request lifecycle and the ability to replace out several key items 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 gain entire management over the delivered HTML. In general, the rendered HTML from ASP.NET web forms apps is dreadful. The web controls it makes use of crank out waste ids and hidden fields in abundance that not only obstruct the efficiency of a site, but also make CSS styling 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 magically crank out markup for you. There aren’t any hidden fields to persist state for you. It’s just you, the HTML, and a couple of extension procedures.

To Unit Test

This, in my viewpoint, is the most compelling reason to use ASP.NET MVC. When it comes to unit testing, ASP.NET MVC simply surpasses ASP.NET web forms. It’s not even close. Whereas ASP.NET web forms requires you to jump through all sorts of hoops to test around the page event lifecycle, the ASP.NET MVC framework pretty much begs to be tested. There are interfaces almost everywhere proclaiming “mock me up!”.

There’s a reason why the most significant ASP.NET MVC supporters also are inclined to be TDD proponents; it’s because ASP.NET MVC actually allows for for TDD. Professionally, I think this is where all the passion comes from. Basically put: it’s really hard to do TDD with ASP.NET web forms and truly straightforward to do it in ASP.NET MVC.

To Look at Something New

I should point out that understanding ASP.NET MVC is an extremely engaging process since the ASP.NET MVC framework team has been so interactive in the process. I feel a substantial part of the attractiveness of ASP.NET MVC is that the community’s suggestions is not only being taken into consideration, it is actively being sought after. The framework has sparked so many discussions and dialogues over best practices that simply following along introduces you to concepts you might formerly have been ignorant of. I would actually propose mastering the ASP.NET MVC framework for this reason 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 think it should be. The incentive for using the framework fundamentally comes down to unit testing, control/extensibility, and feeling of boredom/curiosity. Good reasons, but barely game breakers for the large greater part of developers out there

Facebooktwittergoogle_plusredditpinterestlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *