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).
相关推荐
白色大气风格的旅游酒店企业网站模板.zip
python实现用户注册
Matlab领域上传的视频均有对应的完整代码,皆可运行,亲测可用,适合小白; 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可私信博主; 4.1 博客或资源的完整代码提供 4.2 期刊或参考文献复现 4.3 Matlab程序定制 4.4 科研合作
内容来源于网络分享,如有侵权请联系我删除。另外如果没有积分的同学需要下载,请私信我。
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于计算机科学与技术等相关专业,更为适合;
内容概要:文档名为《平方表,派表集合.docx》,主要内容是1至1000的平方值以及1至1000与π的乘积结果。每个数字从1开始,逐步增加至1000,对应地计算了平方值和乘以π后的值。所有计算均通过Python脚本完成,并在文档中列出了详细的计算结果。 适合人群:需要进行数学计算或程序验证的学生、教师和研究人员。 使用场景及目标:用于快速查找特定数字的平方值或其与π的乘积,适用于教学、科研及程序测试等场景。 阅读建议:可以直接查阅所需的具体数值,无需从头到尾逐行阅读。建议在使用时配合相应的计算工具,以验证和拓展数据的应用范围。
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于计算机科学与技术等相关专业,更为适合;
白色大气风格的健身私人教练模板下载.zip
白色简洁风的商务网站模板下载.zip
白色大气风格的前端设计案例展示模板.zip
内容概要:本文介绍了两个有趣的圣诞树项目方向:一是使用Arduino或Raspberry Pi开发可编程的圣诞树灯光控制系统;二是基于MATLAB开发一个圣诞树模拟器。前者通过硬件连接、编写Arduino/Raspberry Pi程序、MATLAB控制程序来实现LED灯带的闪烁;后者则通过创建圣诞树图形、添加动画效果、用户交互功能来实现虚拟的圣诞树效果。 适合人群:具备基本电子工程和编程基础的爱好者和学生。 使用场景及目标:①通过硬件和MATLAB的结合,实现实际的圣诞树灯光控制系统;②通过MATLAB模拟器,实现一个有趣的圣诞树动画展示。 阅读建议:读者可以根据自己的兴趣选择合适的项目方向,并按照步骤进行动手实践,加深对硬件编程和MATLAB编程的理解。
白色扁平风格的温室大棚公司企业网站源码下载.zip
Navicat.zip
内容概要:本文详细介绍了主成分分析(PCA)技术的原理及其在Scikit-learn库中的Python实现。首先讲解了PCA的基本概念和作用,接着通过具体示例展示了如何使用Scikit-learn进行PCA降维。内容涵盖了数据准备、模型训练、数据降维、逆转换数据等步骤,并通过可视化和实际应用案例展示了PCA的效果。最后讨论了PCA的局限性和参数调整方法。 适合人群:数据科学家、机器学习工程师、数据分析从业者及科研人员。 使用场景及目标:适用于高维数据处理,特别是在需要降维以简化数据结构、提高模型性能的场景中。具体目标包括减少计算复杂度、提高数据可视化效果和改进模型训练速度。 其他说明:本文不仅提供了详细的代码示例,还讨论了PCA在手写数字识别和机器学习模型中的应用。通过比较原始数据和降维后数据的模型性能,读者可以更好地理解PCA的影响。
VOC格式的数据集转COCO格式数据集 VOC格式的数据集转YOLO格式数据集。内容来源于网络分享,如有侵权请联系我删除。另外如果没有积分的同学需要下载,请私信我。
数字信号处理课程设计.doc
白色扁平化风格的灯饰灯具销售企业网站模板.zip
华豫佰佳组合促销视图.sql
白色大气风格的商务团队公司模板下载.zip
白色大气风格的VPS销售网站模板.zip