微软将要推出自己的MVC框架(altnetconf - Scott Guthrie announces ASP.NET MVC framework at Alt.Net Conf)

原创 2007年10月08日 13:34:00
/*评
相信这是很多像我这样正在做企业asp.net开发的同志们正在做或者已经做的一件事情。但不管怎么样,微软要做咱还真拦不住人家。而且也确实是好事,省的人家老喊支持企业开发,结果连一个像样的企业Framework都没有。别说人家还真支持,只不过是另一个产品。。。。。。
但愿这次不要先搅屎,尽管这是微软一贯的风格。还要感谢开源对微软的压力啊!
*/

URL:http://codebetter.com/blogs/jeffrey.palermo/archive/2007/10/05/altnetconf-scott-guthrie-announces-asp-net-mvc-framework-at-alt-net-conf.aspx

altnetconf - 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 instead and 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).


  <script type="text/javascript"><!-- google_ad_client = "pub-2707591418901931"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; //2007-10-13: UML, Asp.net, C#, Web, Windows google_ad_channel = "8453955143+4742004941+7038906246+2072086804+3312032078"; google_ui_features = "rc:6"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

如何调试最新的asp.net mvc源码

最近在研究asp.net mvc的源码,于是在想,既然提供了源码,那我们如何进入源码调试了?在网上找了一些调试的方法,试了几个都不行,于是折腾了一上午,终于弄出来了,下面看看我的操作步骤。   一...
  • dyllove98
  • dyllove98
  • 2013年06月15日 14:56
  • 5758

ASP.NET MVC企业级项目框架

MVC项目搭建笔记----   项目框架采用ASP.NET MVC+Entity Framwork+Spring.Net等技术搭建,搭建过程内容比较多,结合了抽象工厂的思想降低了三层之间的...
  • qq798833488
  • qq798833488
  • 2016年05月06日 11:31
  • 762

排序、 筛选和分页与 ASP.NET MVC 应用程序中的实体框架

http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/sorting-filtering-...
  • jsjpanxiaoyu
  • jsjpanxiaoyu
  • 2016年08月28日 23:21
  • 1165

ASP.NET MVC 音乐商店完整项目示例

MusicStore 项目的完整配套视频! 这是一个系列文章,原文内容出自微软的 MusicStore。 首先对原文内容进行了简单的翻译,以方便大家参考,另外对于其中的部分内容,也进行...
  • guoshaoqing001
  • guoshaoqing001
  • 2015年08月12日 16:02
  • 1866

搭建了一个多项目、插件化的ASP.net MVC开发框架

对于小型的网站,把所有的界面、功能都建到一个项目中也就可以了。但是当项目比较大、参与人数比较多的话,如果还是大家基于一个项目开发的话就是一个灾难了。 今天我搭建了一个ASP.net MVC的多项目框架...
  • cownew
  • cownew
  • 2016年01月21日 19:28
  • 4512

解析ASP.NET WebForm和Mvc开发的区别

因为以前主要是做WebFrom开发,对MVC开发并没有太深入的了解。自从来到创新工场的新团队后,用的技术都是自己以前没有接触过的,比如:MVC 和EF还有就是WCF,压力一直很大。在很多问题都是不清楚...
  • yisuowushinian
  • yisuowushinian
  • 2013年12月29日 01:59
  • 53230

学习ASP.NET MVC5框架揭秘笔记-ASP.NET MVC是如何运行的(五)

完整的流程 对于我们创建的这个迷你版的ASP.NET MVC框架来说,虽然很多细节被直接忽略掉,但是它基本上能够展现整个ASP.NET MVC框架的全貌,支持这个开发框架的核心对象可以说一个不少...
  • michaeljeff
  • michaeljeff
  • 2015年11月14日 19:35
  • 872

MVC5 Entity Framework学习之处理并发

之前你已经学习了如何更新数据。在本节教程中将展示当多个用户在同一时间更新同一实体时如何处理冲突。 你将修改web页面来处理Department实体,使得它们能够处理并发错误。下面的截图显示了索引和删除...
  • zhang957411207
  • zhang957411207
  • 2014年10月12日 12:37
  • 4153

学习ASP.NET MVC5框架揭秘笔记-ASP.NET MVC是如何运行的(二)

路由 对于一个ASP.NET MVC应用来说,针对HTTP请求的处理实现在目标Controller类型的某个Action,每个HTTP请求不在像ASP.NET Web Forms应用一样是针对一个物理...
  • yejinwei1220
  • yejinwei1220
  • 2015年05月14日 15:06
  • 639

[ASP.NET]分析MVC5源码,并实现一个ASP.MVC

本节内容不是MVC入门教程,主要讲MVC原理,实现一个和ASP.NET MVC类似基本原理的项目.   MVC原理是依赖于ASP.NET管道事件基础之上的.对于这块,可阅读上节内容 [ASP...
  • xiaohaisen
  • xiaohaisen
  • 2015年09月24日 10:46
  • 3165
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:微软将要推出自己的MVC框架(altnetconf - Scott Guthrie announces ASP.NET MVC framework at Alt.Net Conf)
举报原因:
原因补充:

(最多只允许输入30个字)