`
ruilin215
  • 浏览: 1142605 次
  • 性别: Icon_minigender_2
  • 来自: 成都
文章分类
社区版块
存档分类
最新评论

Scott Guthrie announces ASP.NET MVC framework at Alt.Net Conf

阅读更多

Scott Guthrie announces ASP.NET MVC framework at Alt.Net Conf

Scott Guthrie proposed a topic at the Alt.Net Conference today, and the topic was an overview of the MVC Framework his team is working on. His topic is actually the first timeslot of the conference at 9:30am tomorrow morning. Just about everyone showed interest, so I wouldn't be surprised to see most of the folks just listening.

Scott and I had supper after the opening, and I received a personal demo of the prototype. First, here are some of the goals:

  • Natively support TDD model for controllers.
  • Provide ASPX (without viewstate or postbacks) as a view engine
  • Provide a hook for other view engines from MonoRail, etc.
  • Support IoC containers for controller creation and DI on the controllers
  • Provide complete control over URLs and navigation
  • Be pluggable throughout
  • Separation of concerns
  • Integrate nicely within ASP.NET
  • Support static as well as dynamic languages

I'm sure I missed some of the goals, and more people will blog their takeaways since this all is public information.

The first question might be: Is webforms going away? Do I have to rewrite my web applications? Some people might wish, but no. Both models will be supported and even be supported within the same web application. I, for one, after seeing this, think it is very good, and my company will be recommending it to our clients.

We might get a public CTP by the end of the year, and it will be released in a similar fashion as ASP.NET AJAX was, as an add-on after the Visual Studio 2008 release some time next year.

URLs

The default URL scheme will look something like this:

/<RouteName>/<Action>/<Param1>/<Param2>

where RouteName is configured to map to SomeController. Multiple routes can map to the same controller for the purpose of providing more URLs (think SEO).

The developer can completely override the URL processing also by providing an implementation of an interface.

Controllers

Controllers will inherit from a base class by default, but it doesn't hinder unit testing, and it's not even required. I'll probably use the option of implementing the IController interface insteadand creating a controller factory to support controller creation using my IoC container of choice (currently StructureMap). In this manner, I implement an interface with one method that accepts IHttpContext (yep, we have an interface now), and RouteData, a simple DTO that includes the action and parameters for the web request (parsed from the URL scheme you are using).

Views

Like I said before, NVelocity, Brail, etc can be bolted on as view engines, and ASPX is provided as a view engine (the only thing that has been changed is that the code-behind will inherit from ViewPage as opposed to the current Page). Controllers can either using IViewEngine (I think that's the name) to request a view by name (key) or using a helper method on the optional controller base class RenderView(string, viewData). The default model uses a DTO for the objects passed to the view, so it is similar to MonoRail's property bag except it's a strongly-typed DTO (using generics for that), so when you rename stuff with Resharper, you don't have to worry about any string literals lying around.

My impressions

I first saw the early prototype in March of this year, and I was encouraged.I was able to give some early feedback, which has already been encorporated into the product. I'm not one to promote a Microsoft offering just because it's there (I have never recommended the use of MSTest over NUnit, for instance), but I will say this: As soon as I can get my hands on a build, I will be building something with it. I am very encouraged by this, and I think they are going in the right direction. While they have chosen a model to use with demos, they have broken down the walls. Interfaces abound, and none of it is sealed. I will start by swapping out the controller factory so I can get my IoC container in the mix, but it's easy to do. For testing, there is no coupling of the controller. The views are decoupled. The httpcontext is decoupled with the new IHttpContext interface. The actions are simple public methods with an attribute attached to them ([ControllerAction], I think).

Isn't it just like MonoRail?

Someone using MonoRail for more serious project than me can comment more intelligently, but here goes.MonoRail is MVC. This is MVC, so yes, it's very similar but different. This gives us a controller that executes before a view ever comes into play, and it simplifies ASPX as a view engine by getting rid of viewstate and server-side postbacks with the event lifecycle. That's about it. MonoRail is much more. MonoRail has tight integration with Windsor, ActiveRecord and several view engines. MonoRail is more than just the MVC part. I wouldn't be surprised if MonoRail were refactored to take advantage of the ASP.NET MVC HttpHandler just as a means to reduce the codebase a bit. I think it would be a very easy move, and it would probably encourage MonoRail adoption (even beyond its current popularity).

分享到:
评论

相关推荐

    ASP.NET MVC 1.0高级编程

     本书由ASP.NET小组成员编写,Scott Guthrie首先提供了一个说明如何构建应用程序的完整演示,然后深入介绍MVC的基本概念和历史,并快速过渡到讨论ASP.NET MVC模式如何实现这些概念。在学习本书的过程中,您将理解...

    Professional ASP.NET MVC 2

    《Professional ASP.NET MVC 2》是一本深入探讨ASP.NET MVC框架第二版的专业书籍,由Jon Galloway、Phil Haack、Scott Hanselman、Scott Guthrie和Rob Conery等多位业界专家共同编写。这本书旨在帮助读者全面理解并...

    ASP.NET MVC 2 in Action

    The ASP.NET MVC Framework was the vision of Scott Guthrie in early 2007. With a prototype demonstration in late 2007 and a key hire of Phil Haack as the Senior Program Manager of the feature team, Mr....

    精通ASP.NET MVC 1.0(Professional ASP.NET MVC1.0)

    本书由Scott Guthrie撰写的第一章,是关于构建ASP.NET MVC应用程序的详细指南。它包含了从零开始创建一个小而完整的ASP.NET MVC应用所需的所有基础知识。以下是对该章节中涵盖的关键知识点进行的详细解释: 1. **...

    Professional.ASP.NET.MVC.2 optimize

    《Professional ASP.NET MVC 2 Optimize》是一本深入探讨ASP.NET MVC 2框架的专业书籍,由Jon Galloway、Phil Haack、Scott Hanselman、Scott Guthrie和Rob Conery等知名作者联合撰写。本书不仅介绍了ASP.NET MVC 2...

    Wrox Professional ASP .Net MVC 2

    ### Wrox Professional ASP .Net MVC 2 #### 知识点概述 本书《Wrox Professional ASP .Net MVC 2》是一本深入介绍 ASP .Net MVC 2 的专业指南,主要面向中级到高级的 .NET 开发者。它由几位业界知名专家合著,...

    Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)

    - **第三章:从ASP.NET到ASP.NET MVC**:比较了传统ASP.NET Web Forms与ASP.NET MVC的不同之处,以及为何选择MVC作为新的开发标准。 - **第四章:路由与URL**:讲解了ASP.NET MVC中的URL管理和路由机制,如何自定义...

    Professional ASP.NET MVC 1.0原版第三部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to ...

    Professional ASP.NET MVC 1.0原版第六部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to ...

    Professional ASP.NET MVC 1.0原版第五部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to ...

    Professional ASP.NET MVC 1.0 原版第二部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to ...

    Professional ASP.NET MVC 1.0原版第四部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-New Project menu command within Visual Studio to ...

    Professional ASP.NET MVC 1.0原版第一部分

    This book begins with you working along as Scott Guthrie builds a complete ASP.NET MVC reference application. He begins NerdDinner by using the File-&gt;New Project menu command within Visual Studio to ...

    25个优秀的_ASP.NET_MVC教程及文章

    Scott Guthrie 发布了 Nerd Dinner 教程的 PDF 和 HTML 版本,该教程全面介绍了 ASP.NET MVC 的基础概念,并演示了如何构建一个完整的 ASP.NET MVC 应用程序。 **详细知识点:** - **MVC 架构详解**:详细解释 MVC...

    [ASP.NET.4揭秘(卷2)].(.ASP.NET.4.Unleashed).谭振林等

     ——Scott Guthrie,ASP.NET之父,微软公司副总裁 “本书涵盖了ASP.NET程序员所需要的一切知识,深度无与伦比,绝对不容错过。别忘了,作者可是微软传奇人物,是我们所有ASP.NET开发者的偶像。”  ——David Betz...

    asp.net 2.0 高级编程部分

    - **ASP.NET 的出现**:在 ASP 3.0 发布之后不久,Microsoft 内部的 Marc Anders 和 Scott Guthrie 提出了一个新的想法——XSP,这是一种采用面向对象编程方式开发 Web 应用的新方法。这一概念最终演变为 ASP.NET,...

    ASP.NET v2.0 揭密(CHM).rar

    "ASP.NET v2.0 揭密"是一部由Scott Guthrie编写的经典教程,这本书深入浅出地介绍了ASP.NET 2.0的各种特性和开发技巧,帮助开发者掌握这一版本的核心技术。 本书主要涵盖以下几个关键知识点: 1. **改进的页面生命...

    微软的jQuery国际化插件-Scott Guthrie 博客中文版

    微软的jQuery国际化插件-Scott Guthrie 博客中文版

Global site tag (gtag.js) - Google Analytics