关于asp.net mvc预览版2及其他的一些思考

【原文地址】:Thoughts on ASP.NET MVC Preview 2 and Beyond

【原文发表时间】: Mar 10, 2008

     At this year’s Mix conference, we announced the availability of the second preview for ASP.NET MVC which you can download from here. Videos highlighting MVC are also available.

在今年的Mix会议上,我们发布了asp.net mvc预览第二版,你可以在这里下载到,视频可以在这里下载

Now that I am back from Mix and have time to breathe, I thought I’d share a few (non-exhaustive) highlights of this release as well as my thoughts on the future.

现在开完了Mix会议,我有时间稍作休息,我想分享一些这一版本的亮点,以及我对未来的一些想法。

New Assemblies and Routing

新的Assemblies Routing

Much of the effort and focus of this release was put into routing. If you’ve installed the release, you’ll notice that MVC has been factored into three assemblies:

这个版本的大多数精力都放在routing上。如果你安装了这一版本,你会发现MVC已经被分解成下面三个集合:

· System.Web.Mvc

· System.Web.Routing

· System.Web.Abstractions

The key takeaway here is that MVC depends on Routing which depends on Abstractions.

这里关键点是:MVC依赖Routing,Routing依赖Abstractions(译注:takeaway不知如何翻译)

MVC => Routing => Abstractions

Routing is being used by another team here at Microsoft so we worked on making it an independent feature to MVC. MVC relies heavily on routing, but routing doesn’t have any knowledge of MVC. I’ll write a follow up post that talks about the implications of that and how you might use Routing in a non-MVC context.

微软另外一个工作组也正在使用Routing,因此我们要做的工作是把Routing变为MVC一个独立的特性 。MVC主要依赖于routing工作,但routing本身不使用到任何MVC的内容。以后我会写一篇文章专门来讨论这个问题以及如何在没有MVC的背景下使用Routing。

Because of the other dependencies on Routing, we spent a lot of time trying to make sure we got the API and code correct and making sure the quality level of routing meets an extremely high bar. Unfortunately, this investment in routing did mean that we didn’t implement everything we wanted to implement for MVC core, but hey, it’s a preview right? ;)

由于Routing还有其他的附属物,我们花了很长时间来确保我们得到了正确的API和代码并确保routing的质量达到一个相当高的水平。不幸的是,我们在routing里的努力并没有实现我们想为MVC核心实现的所有东西,但是,这幸好这只还是个预览版 ;)。

CodePlex Builds

At Mix this year Scott Hanselman’s gave a great talk (IMHO) on MVC. One thing he announced during that talk is the vehicle by which we will be making the MVC source code available. Many of you might recall ScottGu’s recent roadmap for MVC in which he mentioned we would be making the source available. At Mix, Scottha announced that we would be deploying our source to CodePlex soon.

在这次Mix会议上,Scott Hanselman’s 做了一个关于MVC的演讲(IMHO)。其中他宣布了我们将开放MVC源代码的载体,你们也许会联想到ScottGu’s最近的MVC路线图,这路线图里他提到了我们将要开放源代码。在Mix会议上,Scottha宣布我们将很快把源代码放到CodePlex上。

Not only that, we hope to push source from our source control to a CodePlex Project’s source control server on a semi-regular basis. These builds would only include source (in a buildable form) and would not include the usual hoopla with associated with a full Preview or Beta release.

不仅如此,我们希望在半规则基础上,将源代码从我们的代码管理器放到CodePlex项目的代码管理服务器上。这些builds仅包括源代码(以可编译的形式),不包括一般的与完整预览或beta版相关联的hoopla(?)

How regular a schedule we keep to remains to be seen, but Scott mentioned in his talk around every four to six weeks. Secretly, between you and me, I’d love to push even more regularly. Just keep in mind that this is an experiment in transparency here at Microsoft, so we’ll start slow (baby steps!) and see how it progresses. In spirit, this would be the equivalent to the daily builds that are common in open source projects, just not daily.

怎样制订日程现在还不知道,但Scott在他的谈话中提到,大约每隔四至六星期上传一次。悄悄的告诉你,我将更频繁的上传。只要记住,这是微软对于透明性开发的一次尝试,所以我们将有一个缓慢的开始来看一下它是怎样进展的。在精神上,他与开源项目中常见的每日编译是相同的,只是它不是每天编译。

Unit Test Framework Integration

单元测试框架的整合

In a recent post, I highlighted some of the work we’re doing around

integrating third party unit testing frameworks

在最近的一篇文章中,我重点讲了我们正在做的关于整合第三方单元测试框架的一些工作。

I’ve been in contact with various unit testing framework developers about integrating their frameworks with the MVC project template. I’m happy to see that MbUnit released updated installers that will integrate MbUnit into this dropdown. Hopefully the others will follow suit soon.

我已经与许多单元测试框架的开发者进行了联系,讨论把他们的框架与MVC项目模板整合。很高兴看到MbUnit released updated installers将把MbUnit整合进这个dropdown.希望其他人也能很快这样做。

One interesting approach I should point out is that this is a great way to integrate your own totally tricked out unit testing project template complete with your favorite mock framework and your own private assembly full of your useful unit test helper classes and methods.

我想指出的很有趣的一点是,将你们自己完全独立的单元测试项目模板,与你们喜欢的模拟框架以及装满了有用的单元测试帮助类及方法的私有集合完全整合在一起,这是一个非常好的方法。

If you’re interested in building your own customized test framework project which will show up in this dropdown, Joe Cartano of the Web Tools team posted an updated streamlined walkthrough on how to do so using NUnit and Rhino Mocks as an example.

如果你对建立自己定制的测试框架项目(将出现在这个dropdown里)有兴趣,怎样来做,web工具工作组里的Joe Cartano写了一篇updated streamlined walkthrough,它是以使用NUnitRhino Mocks为例的

Upcoming improvements

待改善之处

One area in this preview we need to improve is the testability of the framework. The entire MVC dev team had a pause in which we performed some app building and uncovered some of the same problems being reported in various forums. Problems such as testing controller actions in which a call to RedirectToAction is made. Other problems include the fact that you need to mock ControllerContext even if you’re not using it within the action. There are many others that have been reported by various people in the community and we are listening. We ourselves have encountered many of them and definitely want to address them.

在这预览版中 我们需要改进的一个地方是框架的可测试性,在我们做一些项目building时,整个MVC开发团队有了一些中断,发现了一些在许多论坛被提出的同样的问题。类似于调用RedirectToAction出现的testing controller actions问题。其他的问题包括这样一个事实:你需要模拟ControllerContext,即使你不在action中使用它。社区还有许多人报道了一些其他的问题,我们正在听取。我们自己也遇到了其中的一些问题,当然也想解决他们。

Experiencing the pain ourselves is very important to understanding how we should fix these issues. One valuable lesson I learned is that a framework that is testable does not mean that applications built with that framework are testable. We definitely have to keep that in mind as we move forward.

To that end, we’ll be applying some suggested improvements in upcoming releases that address these problems. One particular refactoring I’m excited about is ways to make the controller class itself more lightweight. Some of us are still recovering from Mix so as we move forward, I hope to provide even more details on specifically what we hope to do rather than this hand-waving approach. Bear with me.

去亲身体验这种痛苦能有助于我们更好地解决这些问题。我得到的一个有价值的教训是:一个可测试的框架并不是指那些用框架所建立的程序是可测试的。当我们继续工作时我们必须记住这一点。最终,我们会发行一个解决这些问题的版本,这一版本里会应用一些大家提出的改善的意见。尤其另我激动的是使controller类自身变的更加轻量级。我们的一些人在Mix后还在休息阶段,所以当我们继续工作时,我希望提供我们想做的东西的更多的具体细节,而不是笼统地说一下。Bear with me.

During this next phase, I personally hope to have more time to continuously do app building to make sure these sort of testing problems don’t crop up again. For the ones that are out there, I take responsibility and apologize. I am a big a fan of TDD as anyone and I hate making life difficult for my brethren. ;)

在下一阶段,我个人希望有更多的时间继续做app building,来确保这些测试问题不再发生。对于已经发生的问题,我有责任并且向大家道歉。我和任何人一样我也是TDD的大粉丝,我讨厌把生活变的麻烦。;)

RTM

When do we RTM? This is probably the most asked question I get and right now, I don’t have a good answer. In part, because I’m still trying to sort through massive amounts of feedback regarding this question. Some questions I’ve been asking various people revolve around the very notion of RTM for a project like this :

什么时候RTM?这也许是我被问及的一个最频繁的问题,但我目前还没有一个确定的答案。一方面,因为我一直在对关于这个问题的反馈进行归类。我被问及的一些问题,许多人把RTM定义为这样一个项目:

· How important is RTM to you?

· RTM对你来说有多重要?

· Right now, the license allows you to go-live and we’ll provide the source, is that good enough for your needs?

· 目前,我们使用go-live协议,我们会提供源代码,这足够满足你们的需要了吧?

· Is it really RTM that you want, or is it the assurance that the framework won’t churn so much?

· 你们是真的需要RTM吗?或者她只是用来确保框架不会乱改?

· What if we told you what areas are stable and which areas will undergo churn, would you still need the RTM label?

· 如果我们告诉你哪些区域是稳定,哪些区域会有变动,你还会需要RTM标志吗?

· Is there a question I should be asking regarding this that I’m not? ;)

· 这句就不翻译了 J

I do hope to have a more concrete answer soon based on this feedback. In general, what I have been hearing from people thus far is they would like to see an RTM release sooner rather than later, even if it is not feature rich. I look forward to hearing from more people on this.

我确实希望在这个反馈的基础上有更加具体的回答,总之,到目前我一直听到是:大家希望看到RTM版尽快发行,即使它的特性不够丰富。我期待更多人对于此的想法。

Closing Thoughts

最后的想法

In general, we have received an enormous amount of interest and feedback in this project. Please do keep it coming as the constructive feedback is really shaping the project. Tell us what you like as well as what is causing you problems. We might not respond to every single thing reported as quickly as we would like to, but we are involved in the forums and I am still trying to working through the massive list of emails accrued during Mix.

总之,我们收到无数了对于这个项目的兴趣以及反馈。请继续,因为建设性的反馈的确正在塑造这一项目。告诉我们你们喜欢的,和导致问题的东西。我们可能无法如愿尽快回应没一个反馈,但是我们关注这论坛,我仍将处理由于Mix会议所积累的邮件。

译者注:由于是刚开始做翻译,很多语句和单词翻译的很有问题,有些单词还不会翻译比如文章中出现的DropDown,hoopla等,所以现在的文章是中英文对照着发的,如果你看到哪里不爽,或者哪里变扭 指正,我会不断改进,不断学习的。谢谢

posted @ 2008-03-14 00:58  lu xu  阅读(599)  评论(0编辑  收藏  举报