ASP.NET MVC与Zeitgeist

时间:2022-11-30 22:38:01

ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarize how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use and feelgood factor welcome.

ASP.NET MVC似乎是一个非常大的入口。任何人都可以总结一下它的MVC实现如何与其他语言的流行MVC框架相叠加? (我正在考虑Rails和Zend Framework,虽然显然有很多。)观察学习曲线,常用术语,易用性和感受良好的因素欢迎。

(For the sake of a little background, I've been avoiding using ASP.NET for some time because I really hate the webforms approach, but Jeff's prolific praise on the podcast has almost convinced me to give it a go.)

(为了一点背景,我一直避免使用ASP.NET一段时间,因为我真的很讨厌webforms方法,但Jeff对播客的高度评价几乎让我信服它。)

2 个解决方案

#1


7  

I'm just getting into ASP.NET MVC, so these are some early thoughts comparing it to Rails:

我刚刚进入ASP.NET MVC,所以这些是与Rails比较的早期想法:

Mostly manages to stick with static typing, at the expense of a little extra code.
This will either give you the warm fuzzies or make you feel slightly shackled depending on how you feel about dynamic typing. For instance, you can have your views expect particular typed data (and so get compile-time checking of your views).

大多数设法坚持使用静态类型,而代价是一些额外的代码。这将为您提供温暖的模糊或让您感觉轻微镣铐,这取决于您对动态打字的感受。例如,您可以让您的视图期望特定类型的数据(以便对您的视图进行编译时检查)。

Better separation of bits of the framework.
So there's no prescribed data access mechanism such as ActiveRecord in Rails; you're free to choose your own. LINQ feels similar if you want something cheap, if a bit more verbose. You can use the non-WebForms parts of ASP.NET like caching and authentication.

更好地分离框架的位。因此,没有规定的数据访问机制,如Rails中的ActiveRecord;你可以*选择自己的。如果你想要一些便宜的东西,LINQ感觉相似,如果有点更冗长。您可以使用ASP.NET的非WebForms部分,如缓存和身份验证。

Still playing feature catch-up.
Preview 5 brought AcceptVerbs, model updaters (similar to Ruby's hash.merge) and more ways to bind forms to models. Feels like there's still more to come before they check off most of the feature set that Rails has.

仍在玩特色追赶。预览5带来了AcceptVerbs,模型更新程序(类似于Ruby的hash.merge)以及将表单绑定到模型的更多方法。在他们检查Rails的大部分功能集之前,还有更多感觉。

I'm still missing a little of Rails' freedom and elegance (much of which is down to Ruby, I guess), but ASP.NET MVC really does feel quite close.

我仍然缺少一些Rails的*和优雅(其中大部分都归功于Ruby,我猜),但ASP.NET MVC确实感觉非常接近。

#2


1  

If you're already programming in the .NET idiom, it's pretty easy to pick up on a lot of what's going on in the MVC Framework. Rails, on the other hand, can be pretty easy to pick up (granted, at a basic level) if you've never set eyes on Ruby before you start.

如果您已经使用.NET习惯进行编程,那么很容易理解MVC框架中的许多内容。另一方面,如果您在开始之前从未关注过Ruby,那么Rails可以很容易地获取(在基本级别授予)。

It seems like you're talking about quality-as-MVC, though, and it looks to me like both frameworks (can't speak for Zend) do a very good job of separating the concerns.

看起来你在谈论质量和MVC,但在我看来,两个框架(不能代表Zend)都能很好地分离问题。

#1


7  

I'm just getting into ASP.NET MVC, so these are some early thoughts comparing it to Rails:

我刚刚进入ASP.NET MVC,所以这些是与Rails比较的早期想法:

Mostly manages to stick with static typing, at the expense of a little extra code.
This will either give you the warm fuzzies or make you feel slightly shackled depending on how you feel about dynamic typing. For instance, you can have your views expect particular typed data (and so get compile-time checking of your views).

大多数设法坚持使用静态类型,而代价是一些额外的代码。这将为您提供温暖的模糊或让您感觉轻微镣铐,这取决于您对动态打字的感受。例如,您可以让您的视图期望特定类型的数据(以便对您的视图进行编译时检查)。

Better separation of bits of the framework.
So there's no prescribed data access mechanism such as ActiveRecord in Rails; you're free to choose your own. LINQ feels similar if you want something cheap, if a bit more verbose. You can use the non-WebForms parts of ASP.NET like caching and authentication.

更好地分离框架的位。因此,没有规定的数据访问机制,如Rails中的ActiveRecord;你可以*选择自己的。如果你想要一些便宜的东西,LINQ感觉相似,如果有点更冗长。您可以使用ASP.NET的非WebForms部分,如缓存和身份验证。

Still playing feature catch-up.
Preview 5 brought AcceptVerbs, model updaters (similar to Ruby's hash.merge) and more ways to bind forms to models. Feels like there's still more to come before they check off most of the feature set that Rails has.

仍在玩特色追赶。预览5带来了AcceptVerbs,模型更新程序(类似于Ruby的hash.merge)以及将表单绑定到模型的更多方法。在他们检查Rails的大部分功能集之前,还有更多感觉。

I'm still missing a little of Rails' freedom and elegance (much of which is down to Ruby, I guess), but ASP.NET MVC really does feel quite close.

我仍然缺少一些Rails的*和优雅(其中大部分都归功于Ruby,我猜),但ASP.NET MVC确实感觉非常接近。

#2


1  

If you're already programming in the .NET idiom, it's pretty easy to pick up on a lot of what's going on in the MVC Framework. Rails, on the other hand, can be pretty easy to pick up (granted, at a basic level) if you've never set eyes on Ruby before you start.

如果您已经使用.NET习惯进行编程,那么很容易理解MVC框架中的许多内容。另一方面,如果您在开始之前从未关注过Ruby,那么Rails可以很容易地获取(在基本级别授予)。

It seems like you're talking about quality-as-MVC, though, and it looks to me like both frameworks (can't speak for Zend) do a very good job of separating the concerns.

看起来你在谈论质量和MVC,但在我看来,两个框架(不能代表Zend)都能很好地分离问题。