13.2. Why MVC?

MVC is about dividing up your applications. This separation of concerns has a number of advantages:

  • Division/testability: Traditionally, ASP.NET web applications were difficult to test because ASPX and ASCX controls often ended up containing code related to user interface and business logic. In ASP.NET, MVC classes called controllers manage the interaction between the UI and data (model). This separation also makes it much easier to write tests for your application. You can test controller classes directly instead of having to create complex ways of simulating ASP.NET's UI.

  • Flexibility: Because all the layers are decoupled, it should be easy to swap out any individual layer without affecting the others. The ASP.NET MVC framework ...

Get Introducing .NET 4.0: with Visual Studio 2010 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.