At Day 1 of PDC 2008 in Los Angeles, attendees got their first look at a technology Microsoft introduced earlier this month into beta: a new way for building reformed Web applications.
The Web site StackOverflow.com is the latest example of a fully operational Web site, running today out of beta, using a technology from Microsoft that is still in beta: ASP.NET MVC, the new compartmentalization model for content-driven Web site programming.
This afternoon, Microsoft senior program manager Phil Haack showed attendees how many of the functions of StackOverflow could be essentially duplicated -- or shamelessly ripped off -- in about the time it takes to give a talk at PDC. StackOverflow takes comments from developers who are searching for solutions to specific problems; the content of the site, therefore, is like a BBS. It's made up principally of comments from users, who may not necessarily be members. Using ASP.NET MVC, a developer can generate complex queries that produce models of the underlying data. Those models can then be processed using views, which render the comments in very clean HTML code that can be cleaned up using CSS.
An extension to ASP.NET that enables Web developers to make their work more sensible and extensible by compartmentalizing the functions of managing and displaying content into three discrete actors: the model, the view, and the controller.
For the Visual Studio programmer, ASP.NET MVC is a new Web Application Project (WAP) type. Once engaged, it enables him to build the controller, which is effectively the producer of the content of the Web page. Its job is to process requests from the user; through those requests, the controller generates the model of the data for the site. This is the type of content for which sites rely on content management systems of one form or another; here, the controller performs the management functions at the code level.
The absolute division of labor in the development of a content-driven Web site could easily drive down development time. That said, the use of MVC in ASP.NET is nowhere near automatic; its senior program manager at Microsoft, Phil Haack, compared the differences between programming in ASP.NET 3.0 and ASP.NET MVC to driving a manual transmission and an automatic. With a stickshift, Haack said, you have more driving fun, but you have to pay more careful attention to how your brakes are set and what your RPM is -- factors on a much lower level.