简体   繁体   English

ASP.NET MVC与ASP.NET 4.0

[英]ASP.NET MVC vs. ASP.NET 4.0

I watched this webcast recently, and I got the sense that a lot of the "cool stuff" from ASP.NET MVC is getting pulled back into the ASP.NET framework. 我最近观看了这个网络广播 ,我感觉ASP.NET MVC中的很多“很酷的东西”都被拉回到ASP.NET框架中。

At the moment I'm setting the ground-work for a project at my company using ASP.NET MVC, but after watching this, I'm beginning to wonder if that's the right choice, and whether it would behoove me to wait for ASP.NET 4.0. 目前我正在使用ASP.NET MVC为我公司的项目设置基础工作,但看了之后,我开始怀疑这是否是正确的选择,以及我是否应该等待ASP .NET 4.0。

I realize ASP.NET MVC 2.0 is getting close to an actual release. 我意识到ASP.NET MVC 2.0已接近实际版本。

If High-Testability , loose coupling , and having Full control of our HTML are top priorities, which should I choose, ASP.NET 4.0 or ASP.NET MVC? 如果高可测性松散耦合以及完全控制我们的HTML是首要任务,我应该选择ASP.NET 4.0还是ASP.NET MVC?

Well your question doesn't really make sense to me. 那么你的问题对我来说并没有多大意义。

You're asking whether or not to go with ASP.Net MVC or ASP.Net 4.0 - do you mean WebForms? 你问是否要使用ASP.Net MVC或ASP.Net 4.0 - 你的意思是WebForms?

MVC 2.0 will be shipped in the box with VS 2010 and as such same time as .Net 4.0 AND ASP.Net 4.0 - also ASP.Net MVC is a part of ASP.Net. MVC 2.0将在VS 2010的包装盒中发布,与.Net 4.0和ASP.Net 4.0同时发布 - ASP.Net MVC也是ASP.Net的一部分。

If you wish to use the .Net 4.0 runtime and all the features of ASP.Net 4.0 - what's wrong with doing it WITH MVC? 如果你想使用.Net 4.0运行时和ASP.Net 4.0的所有功能 - 用MVC做这个有什么问题?

Also, I'd suggest building onto the MVC 1.0 now and structure your app in a such way that you can easily migrate to and embrace the new features in MVC 2.0 as you already know how most of these will work that shouldn't be too much of an issue. 此外,我建议现在构建到MVC 1.0并以这样的方式构建您的应用程序,以便您可以轻松迁移并接受MVC 2.0中的新功能,因为您已经知道大多数这些功能应该不会太多很多问题。 Or if your release is after the release of ASP.Net MVC 2.0, simply start using it now - unless that poses other issues. 或者,如果您的发布是在ASP.Net MVC 2.0发布之后,那么现在就开始使用它 - 除非这会带来其他问题。

If your application will be released after the March release date, then it's a no brainier. 如果您的申请将在3月份发布日期之后发布,那么这是一个没有头脑的人。 Go with ASP.Net 4.0. 使用ASP.Net 4.0。

If it's not, then it not quite as clear. 如果不是,那就不那么清楚了。 My current company is facing the same issue. 我现在的公司面临着同样的问题。 Do we go with .Net 4.0 or not. 我们是否选择.Net 4.0。 For us, our solution is hosted internally, so we don't have the problem of releasing a product on a unreleased platform. 对我们而言,我们的解决方案是内部托管的,因此我们没有在未发布的平台上发布产品的问题。 Our biggest concern is the changes from beta2 to RTM. 我们最关心的是从beta2到RTM的变化。

As a developer I'm always wanting to move to the newest platform. 作为开发人员,我总是希望转向最新的平台。 A company has to consider it's clients and the risk to move to a new platform. 公司必须考虑客户以及迁移到新平台的风险。 Most of the time caution is more prudent then being the first to jump. 大部分时间谨慎是谨慎的,然后成为第一个跳跃。

ASP.MVC 1.0 is supported and released. 支持并发布ASP.MVC 1.0。 It's a great web framework. 这是一个很棒的Web框架。 If you are not looking for specific features in ASP.MVC 2. Then use ASP.NET MVC 1. 如果您没有在ASP.MVC 2中查找特定功能,那么请使用ASP.NET MVC 1。

If your criteria include this: 如果您的标准包括:

We are aiming for high testability, loose coupling, and "controlled HTML" -- to me that meant ASP.NET MVC. 我们的目标是高可测性,松散耦合和“受控HTML” - 对我而言,这意味着ASP.NET MVC。

Then ASP.NET MVC is a must . 那么ASP.NET MVC是必须的 Even with ASP.NET 4.0, you can't get around the fact that ASP.NET is hard to test for without a lot of extra leg work that just isn't there for MVC. 即使使用ASP.NET 4.0,也无法解决ASP.NET很难测试的问题,如果没有很多额外的工作,而MVC就不存在这些工作。

I use ASP.NET in my 'day job', but at night time I'm ASP.NET MVC all the way. 我在“白天工作”中使用ASP.NET,但是在晚上我一直是ASP.NET MVC。 ASP.NET 4.0 still hangs on to the legacy "Code-Behind" and the View/Controller coupling that goes on with ASP.NET Controls. ASP.NET 4.0仍然依赖于传统的“Code-Behind”和ASP.NET控件的视图/控制器耦合。 These are things that make it much harder to test, and are 'tightly coupled' by definition. 这些东西使得测试更加困难,并且根据定义“紧密耦合”。

Go with whichever makes the most business sense. 选择最具商业意义的产品。 We always feel like waiting for the next best thing...but if we did we'd never get anything accomplished. 我们总是觉得等待下一个最好的事情......但如果我们做到了,我们就永远不会有任何成就。

Choosing a presentation pattern for a new or enterprise web development on the Microsoft platform is a daunting task, in my opinion there are only three; 在Microsoft平台上为新的或企业Web开发选择演示模式是一项艰巨的任务,在我看来只有三个; View Model, Model-View-Presenter (MVP) or ASP.NET MVC (a Model2 derivative). View Model,Model-View-Presenter(MVP)或ASP.NET MVC(Model2衍生物)。

You can read the full article here ASP.NET MVC Patterns 您可以在这里阅读ASP.NET MVC Patterns的完整文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM