Tip

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

I don't know what it is lately, but I find myself bumping into design patterns every which way I turn. I recently reviewed Christopher Alexander's A Pattern Language, and 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. Enjoy!

Ed Tittel is a full-time writer and trainer whose interests include XML and development topics, along with IT certification and information security topics. Email Ed at etittel@techtarget.com with comments, questions or suggested topics or tools to review.

This was first published in February 2009

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.