views:

73

answers:

1

MVC frameworks in general?
Is it different from MVC in desktop GUI applications?
What exactly is it that makes it easier to test than WebForms ?
(Can't you test Code Behind in a similar way to MVC controllers)

I have the impression that ASP.NET MVC is mostly about clean URL's - with controllers processing user input in the form of URLs.

A barbone web forms application in classic ASP for example is very different from the MVC concept. While ASP.NET Webforms with events and page-state goes more in an MVC direction as one thinks of it in a desktop GUI world.

A: 

How about trying Wikipedia?

Quoting: "Model–View–Controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns)".

So it helps making an application organized (because it imposes that you separate your business or domain logic [model] from all interface code [view]).

It also makes much easier to apply TDD.

And, speaking of Web MVC .NET frameworks (like ASP.NET MVC, Castle Monorail or OpenRASTA), they also normally allow:

  1. Seeing web pages as they really are - stateless resources (instead of creating fake state retention, like the ASP.NET WebForms ViewState).
  2. The existence of client-side programmers in your job that do not know (and probably don't want to know) anything about .NET.
  3. Elegance (as opposed to spaghetti code, or, well, WebForms).
  4. Nice URLs!!!

BTW: there are a LOT more benefits, and if you are unable to perceive them, I would recommend that you look beyond the .NET world. You'll notice that almost every other language/environment has at least one MVC framework available:

  • Python has Django.
  • Ruby has Ruby-On-Rails.
  • Java has Spring, Play.
  • PHP has CakePHP, Symfony.
  • And so forth...

Which clearly shows that MVC is an idea worth repeating, and a proven architectural pattern.

rsenna
Much of this you could also say about web forms (except the postback thing). And that you use controllers to process URLs doesn't necessarily make the whole site more MVC.
Olav
rsenna