ASP.NET MVC 与 Ruby on Rails、CakePHP 等相比有何不足。等?

发布于 2024-08-06 15:10:04 字数 356 浏览 4 评论 0原文

我一直在广泛地使用 ASP.NET MVC,我发现它非常有用(与 WebForms 相比),但是我对其他 MVC 框架有一些经验,并且我觉得在功能上存在明显的差距。

其一,在 Drupal 中,您可以连接到任何东西并覆盖它的 View 操作。例如,您可以连接到 Drupal 函数,该函数写出标题并附加自定义内容。我在 ASP.NET MVC 中没有看到这种类型的功能。

与 Spring.NET、RoR、CakePHP 等框架相比,ASP.NET MVC 还有哪些不足?我担心 ASP.NET MVC 是 WebForms 2.0,最终会磨损它以同样的方式受到欢迎,所以从长远来看,我最好转向另一个框架。

问候。

I've been working quite extensively with ASP.NET MVC and I find it extremely useful (compared to WebForms), however I have some experience with other MVC frameworks and I feel there are definite gaps in capability.

For one, in Drupal you can hook into just about anything and override it's View action. e.g. You can hook into the Drupal function that writes out the header and append custom content. I don't see this type of ability in ASP.NET MVC.

Where else does ASP.NET MVC fall short compared to the Spring.NET, RoR, CakePHP, etc. frameworks? I'm worried that ASP.NET MVC is WebForms 2.0 and eventually it is going to wear out it's welcome in the same fashion so I would be best to move to another framework for the longterm.

Regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

酒几许 2024-08-13 15:10:04

与 Spring.NET、RoR、CakePHP 等框架相比,ASP.NET MVC 还有哪些不足?

嗯,半开玩笑的回答,苹果和梨相比到底差在哪里呢? :-) 很难回答如此笼统的问题。我的主要评论是 ASP.NET MVC 非常不固执,即它不会冒犯任何人,而且它确实无法在任何地方使程序员的工作效率提高 10 倍。

可以说,在 RoR 的最佳环境下,Ruby on Rails 之类的东西确实可以将程序员的生产力提高 10 倍。一个例子是单个 Ajax 数据库支持的“联系我”表单,其中 RoR 的 Ajax Javascript 帮助程序确实可以节省大量时间(如果它们适合您的需求)。

ASP.NET MVC 不偏不倚的优点是,您可以在许多出色的技术之间进行挑选,并“混合搭配”您自己的 MVC 框架。有很多很棒的组件可供使用,其中许多都是开源的,您可以使用它们来根据您的选择“调整”ASP.NET MVC。

ASP.NET MVC 的另一个伟大之处是整个工具链的强度——从 Visual Studio、ReSharper 等 Visual Studio 加载项,到 Windows 2008、IIS 7 和 Microsoft 的部署工具,再到 Enterprise Library 等代码示例,对于 .NET Web 应用程序,可以找到大量优秀的工具和帮助。

我担心 ASP.NET MVC 是 WebForms 2.0,最终它会以同样的方式受到欢迎,因此我最好转向另一个长期框架。

绝对不是。看看这个网站上标记为 ASP.NET-MVC 的问题数量,计算一下博客文章——这是一个巨大的成功。此外,谁说 WebForms 已经死了?

事实上 - 我想强调的是,我没有确凿的证据证明这一点,这只是一种感觉 - 事实上,现在可能有更多的程序员积极致力于 ASP.NET MVC 项目与其他语言的某些框架相比,例如 Python 上的 Django,它们被认为是成功的并且“将继续存在”。这只是我的猜测,但在我的开发朋友圈中,ASP.NET MVC 对于如此年轻的项目有着惊人的巨大关注度。这部分来自于“骑在 .NET 的后面”,即因为 .NET 是如此主流并且有如此多的开发人员......

如果满足以下条件,请转向另一个技术堆栈:

  • 您有丰富的经验或偏好对于其他编程语言
  • ,或者如果您在另一个平台上看到您的项目有巨大技术优势(它确实必须是巨大的,以抵消平台经验的损失) 。
  • 也许,如果你正在创办一家初创公司,那么微软不可能收购你的初创公司,但谷歌会,那么也许会根据你预期的收购方偏好来选择你的平台。

否则,如果您喜欢使用 C# / ASP.NET MVC 进行编程,那么就留在原地。 ASP.NET MVC 有着美好的未来。

[事实上,我对 ASP.NET MVC 只有一个真正的抱怨——名称。它并不容易从舌头上滚下来。]

Where else does ASP.NET MVC fall short compared to the Spring.NET, RoR, CakePHP, etc. frameworks?

Hmnn, tongue in cheek answer, where do apples fall short compared to pears? :-) It's hard to answer something so general. My main comment is that ASP.NET MVC is quite un-opinionated, i.e. it offends no-one, and it really doesn't enable 10x programmer productivity anywhere.

Arguably, something like Ruby on Rails does enable 10x higher programmer productivity under optimal circumstances for RoR. A example could be a single Ajax database-backed "contact me" form, where RoR's Ajax Javascript helpers really save a lot of time, if they fit your need.

The upside of ASP.NET MVC's un-opinionated'ness is that you get to pick and choose between lots of great technologies, and "mix and match" your own MVC framework. There are lots of great components available out there, many of them oven open source, with which you can "flavor" ASP.NET MVC to your choosing.

Another great thing about ASP.NET MVC is the strength of the entire tool chain -- from Visual Studio, Visual Studio add-ins like ReSharper, to Windows 2008, IIS 7, and Microsoft's deployment tools, to code samples like the Enterprise Library, there is just a huge amount of great tools and help to be found for .NET webapps.

I'm worried that ASP.NET MVC is WebForms 2.0 and eventually it is going to wear out it's welcome in the same fashion so I would be best to move to another framework for the longterm.

Absolutely not. Look at the number of questions tagged ASP.NET-MVC on this site, count the blog posts -- it's a big success. Besides, who says WebForms has died?

In fact -- and I want to emphasize that I don't have hard evidence for this, it's just a feeling -- in fact there may be more programmers actively working on ASP.NET MVC projects right now than there are on some frameworks in other languages, like Django on Python, which are considered successful and "here to stay". It is only speculation on my part, but amongst my circle of friends in development, ASP.NET MVC has a surprisingly huge mindshare for so young a project. This comes in part from "riding on the back of .NET", i.e. because .NET is so mainstream and has so many developers on it...

Move to another technology stack if:

  • you have a great deal of experience with, or preference for, other programming languages
  • or if you see huge technology benefits for your project in another platform (it really has to be huge, to offset the loss of experience with the platform).
  • maybe, if you're doing a startup, and fx there is no way Microsoft will buy your startup but Google will, then maybe select your platform based on your expected acquirers preference.

Otherwise, if you like programming in C# / ASP.NET MVC, then stay put. ASP.NET MVC has a great future ahead of it.

[In fact, I have only one real gripe with ASP.NET MVC -- the name. It doesn't exactly roll easily off the tongue.]

断肠人 2024-08-13 15:10:04

看来只是VC部分。没有发生任何模型/数据库持久性类型的事情。

你认为这是积极的还是消极的实际上取决于你如何看待它 - 我喜欢在我的 MVC 项目中使用 nHibernate 所以这对我来说可能是一件好事......

It only seems to be the VC part. There is no model / database persistence type stuff going on.

Whether you see this as positive or negative really depends on how you look at it - I love using nHibernate in my MVC projects so it's probably a good thing for me...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文