您的下一个 ASP.NET 项目的选择是什么:Web 窗体还是 MVC? [英] What's your choice for your next ASP.NET project: Web Forms or MVC?

查看:14
本文介绍了您的下一个 ASP.NET 项目的选择是什么:Web 窗体还是 MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您明天将启动一个新的 ASP.NET 网站/应用程序.您会选择 Web Forms 还是 MVC,为什么?

Let's say that you will start a new ASP.NET web site/application tomorrow. Would you chose Web Forms or MVC, and why?

推荐答案

MVC 宝贝!还有 JQuery!

MVC baby! And JQuery!

好的,可以说我的回答需要更多信息.

OK, it's fair enough to say my response warrants a little more info.

我选择 MVC 的原因如下:

I'd choose MVC for the following reasons:

  1. 我曾在 Rails 工作过,发现它的工作效率很高.ASP MVC 借鉴了 Rails 的很多东西,以至于在某些方面感觉像是直接移植(这在我看来是一件好事).
  2. AJAX 很重要,但我讨厌微软对 AJAX 的Atlas"方法(无论现在的产品名称是什么).如果您打算使用 AJAX,您需要了解 HTML 和 JavaScript.对您隐瞒这一点的框架对您的伤害大于对您的帮助 (IMO).
  3. 在 JavaScript 框架方面,JQuery 似乎已经占领了整个世界.ASPMVC 与它很好地集成在一起.我想学习它,所以这里有很好的一致性.
  4. 整个控制"模型是一个巧妙的想法,但它比表面上看起来要复杂得多.例如,在 SO 上查看有关 UserControl 如何找到其包含控件的最高级别等的问题.控制层次抽象中存在泄漏.如果网格可以开箱即用地做您想做的事情,那就太好了,但是很难对它们进行自定义以执行它们不应该做的事情.市场上最好的网格控件(高度可定制的)是大型、臃肿、过于复杂的野兽.也许这表明我们应该回到 HTML 并让我们视图中的循环为我们做那种事情.
  5. 我相信我可以在 ASPMVC 中比在 ASP.Net 中更快地构建完整、漂亮的应用程序(而且我已经掌握了 ASP.Net 多年).看看 StackOverflow ......使用 JQuery 在 ASPMVC 上快速构建,它快速、可扩展并且使用 IMO 很愉快.
  6. 哦,它是完全开源的!可以阅读源代码,写博客,甚至修改然后重新分发它!
  1. I have worked in Rails and found it highly productive. ASP MVC has borrowed so much from Rails that it feels like a direct port in some ways (and that's a good thing in my mind).
  2. AJAX is important, but I hate the Microsoft "Atlas" approach to AJAX (whatever the product name is these days). If you're going to do AJAX, you need to understand the HTML and the JavaScript. Frameworks that hide that from you are hurting you more than they are helping you (IMO).
  3. JQuery has taken over the world it seems in terms of JavaScript frameworks. ASPMVC is well-integrated with it. I want to learn it, so there's great alignment here.
  4. The whole "control" model is a neat idea, but it is more complicated than it appears on the surface. For example, look around on SO for questions about how a UserControl can find its highest level containing control and so forth. The control hierarchy abstraction has leaks in it. Grids are great if they do what you want out of the box, but it's very very hard to customize them to do something they weren't made to do. And the best grid controls on the market (the ones that are highly customizable) are large, bloated, overly complicated beasts. Maybe that shows us that we should drop back down to HTML and let loops in our views do that kind of thing for us.
  5. I believe I can build complete, beautiful apps in ASPMVC much faster than in ASP.Net (and I've got some years of ASP.Net under my belt). Look at StackOverflow ... built quickly on ASPMVC with JQuery, and it's fast, scalable and a joy to use IMO.
  6. Oh, and it's completely open source! It is ok to read the source code, blog about it, and even modify then redistribute it!

这篇关于您的下一个 ASP.NET 项目的选择是什么:Web 窗体还是 MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆