tags:

views:

272

answers:

4

I have a very simple question about MVC.

What is it really and why should I notice it. I know it is not replacement for asp.net but What is it in ASP.NET that I cannot do and hence require MVC .

I know google.com is the best way to find some answers but I thought if someone over here who knows this really well can explain me, I would be very obliged.

+4  A: 

I'll start off by saying that it is a common misconception that MVC is meant to replace Webforms like you had suggested. ASP.NET MVC is just the ASP.NET implementation of the MVC pattern. I would recommend you check out this post and this post. Like you mentioned, you can not only search google but here as well.

You can check out ScottGu's entry explaining it (posted in 2007).
Also the PM of ASP.NET MVC Phil Haack has info in his blogs on MVC

Quintin Robinson
excellent! thanks for the links
+4  A: 

ASP.NET MVC uses a different design pattern than webforms. MVC aims to separate the different concerns into different layers.

ASP.NET MVC has some nice things out of the box for you, like scaffolding (basically you feed it a data source and it generates a basic form for you) and URL rewriting. You can, of course, do this with webforms, but MVC does it out of the box for you, which is nice.

In ASP.NET MVC gives you more control of the markup (or at least more easily gives you control of the markup). For many people this is a real nice-to-have. That said, you also lose some of the things that make ASP.NET webforms easy to work with, like ViewState.

Also, I'd like to add that you can mix and match webforms and MVC, so its not a "all or nothing" situation.

Hope that helped.

Giovanni Galbo
WOW! That was a very good explanation!
+1  A: 

One thing that I'd like to add to previous answers is that if you do not want to embrace MVC at all you can use the MVP Pattern to separate concerns using WebForms.

Here's a nice article from Phil Haack.

http://haacked.com/archive/2006/08/09/ASP.NETSupervisingControllerModelViewPresenterFromSchematicToUnitTestsToCode.aspx

The good thing about the MVP pattern is that you can work in a way that you can switch the presentation logic from ASP.NET to Silverlight, WinForms or even WPF.

Paleta
+2  A: 

It will take you a simple test project with MVC to understand advantages and disadvantages. Reading through blogs and articles though useful will not however bring you much insight. Just check it out, make your own experience.

User