Introduction to ASP.NET's Model View Controller (MVC) Design Pattern

I don't know what it is last year, but I find myself bumping into design patterns every which way I turn. Here I am writing about an explicit design pattern called MVC (for Model-View-Controller).  

The MVC design pattern is widely used in applications that need to maintain multiple views of the same data sets. The fundamental principle at work here is functional separation. Models maintain the actual data; views provide logical windows into that data and control what users can see and interact with; and controllers handle events that might affect either a model or a particular view.

This structure permits multiple views and multiple controllers to interface with a single model, and it permits new views and controllers to be introduced at will without imposing any changes to model designs. As a paragon of uncoupled designs, this one is a real peach! (For more information and some nice diagrams, check out the description of MVC at enode.com).

Given this background, Microsoft's MVC offering may begin to earn its status as a "cool tool" for ASP.NET. It provides scaffolding and support building MVC applications using the ASP.NET framework that provides an interesting and (to many developers) appealing alternative to ASP.NET Web Forms. This tool affords numerous benefits, including:

  • Clear separation of tasks and data views
  • Support for test-driven development approaches
  • Fine-grained control over both HTML and JavaScript code elements
  • User-intelligible URLs (Microsoft calls them "intuitive," but I think they're pushing their luck)

The ASP.NET MVC framework is currently at the release candidate stage, which means it's still in what can only be called a "late beta" mode. Nevertheless, this capability is reasonably mature and surprisingly capable. Check out Microsoft's ASP.NET MVC home page, where you'll find tutorials, videos, a design gallery and some interesting sample applications, as well as the downloads you'll need to start putting this interesting and powerful design pattern to work.

      Please down the mvc framework from http://aspnet.codeplex.com/

 

      Enjoy!

posted @ 2010-03-30 14:54  gybsoft  阅读(281)  评论(0编辑  收藏  举报