Categories
Uncategorized

An MVC Framework for ASP.NET

Screenshot of example app written in the new ASP.NET-based MVC framework
Screenshot from an example app written using the upcoming MVC franework for ASP.NET.

Ruby has Rails, Python has Django and Turbo Gears and PHP has Symfony, Cake and the Zend Framework. Where is the MVC framework for ASP.NET? Scott “ScottGu” Guthrie has an answer

Two weeks ago I blogged about a new MVC (Model View Controller) framework for ASP.NET that we are going to be supporting as an optional feature soon. It provides a structured model that enforces a clear separation of concerns within applications, and makes it easier to unit test your code and support a TDD workflow. It also helps provide more control over the URLs you publish in your applications, and can optionally provide more control over the HTML that is emitted from them.

You’ll be able to start a new MVC web app in Visual Studio by selecting File -> New Project and then selecting ASP.NET MVC Web Application template to create a new web application using it. It’s compatible with any .NET unit-testing system (such as NUnit, MBUnit, MSTest and XUnit) and its deafult directory structure features three main directories named /Models, /Views and /Controllers — you get three guesses as to what goes in them. Easy setup of new projects, support for testing, a directory structure that gives you Rails deja vu — this should be an interesting project to follow.

Screenshot of example app written in the new ASP.NET-based MVC framework

Take a close look at the screenshot below and note the URL: it’s of the form /localhost/controller/action/id, an URL routing scheme that Rails coders should find very, very familiar:

Screenshot of example app written in the new ASP.NET-based MVC framework

I’m just skimming the surface here; Scott goes into considerably greater detail. I’ll be following the project with great interest and taking it for a spin once it becomes available to Visual Studio users.

Links