ASP.NET MVC-拔下WebForms

Acoustic Guitar

As a new Microsoft employee, I like the new-found pragmatism at the Microsoft Developer Devision, typified by projects like the ASP.NET 3.5 Extensions and MVC. Certainly we all know MVC as a concept is nothing new, but it is new as a philosophy for the ASP.NET team (IMHO).

作为Microsoft的新员工,我喜欢Microsoft Developer Devision中新发现的实用主义,以ASP.NET 3.5 Extensions和MVC等项目为代表。 当然,我们都知道MVC作为一个概念并不是什么新鲜事物,但是对于ASP.NET团队(IMHO)来说,它却是一个新的哲学。

Remember that ASP.NET WebForms render using a Control Hierarchy which is fundamental to the whole gestalt of what we think of as ASP.NET. You put an <asp:label> inside an ASPX page and as soon as you mark it 'runat="server"' you've added it to the Control Hierarchy. Any string literals around your control also become part of that hierarchy of objects. The PreRender event is an opportunity for you to affect that tree of controls before the Render event fires and they turn into Angle Brackets (usually HTML). ASP.NET represented a swinging of the needle, as it were, from the Classic ASP way of doing things to an artificial event model that gave us state where there was no state. It added layers and production value and it sounded good, and still sounds good to lots of people.

请记住,ASP.NET WebForms使用控件层次结构进行呈现,这对于我们认为的ASP.NET的整体姿势至关重要。 您将<asp:label>放入ASPX页面中,并将其标记为'runat =“ server”',就将其添加到控件层次结构中。 控件周围的所有字符串文字也会成为该对象层次结构的一部分。 PreRender事件为您提供了在Render事件触发之前影响该控件树的机会,它们将变成Angle Brackets(通常为HTML)。 从经典的ASP处事方式到为我们提供没有状态的状态的人工事件模型,ASP.NET代表了这种变化。 它增加了层次和生产价值,听起来不错,但对许多人来说仍然不错。

However, this leaves a gap in the music. Sometimes I just want to control the stream myself. I want the system to step aside and let me get down to it. Not all the way aside, but certainly out of my general field of view. MVC Frameworks with View engines like ASP.NET MVC and Monorail's many template options and the Django template language and HAML... (Note to self, write HAML view factory for ASP.NET MVC. UPDATE: Crap! The brilliant Andrew Peters made NHAML this last month and added it to MVC Contrib. New Note to self, crush Andrew Peters for being too awesome.) …provide a fresh clean new sound to the same old angle-bracket-based music of the past. Clean, simple, lightweight.

但是,这在音乐中留下了空白。 有时我只想自己控制流。 我希望系统搁置一边,让我开始讨论它。 并非一路顺风,但肯定超出了我的一般视野。 具有View引擎的MVC框架,例如ASP.NET MVC和Monorail的许多模板选项以及Django模板语言HAML ...(自我说明,为ASP.NET MVC编写HAML视图工厂。更新:废话!出色的Andrew Peters制作了NHAML上个月,将其添加到MVC Contrib中。对自己的新记录感到迷惑,因为Andrew Peters太给力了。 )…为过去相同的基于尖括号的音乐提供了全新的全新声音。 清洁,简单,轻便。

Is it MVC that makes this possible? Partially, but we mustn't forget the huge influence of sites like http://www.csszengarden.com and the minimalist markup aesthetic promoted by CSS folks and standards wonks changed the way we think about markup and what can be accomplished with a few H1s and a UL/LI or three.

是MVC使之成为可能吗? 部分,但我们不能忘记http://www.csszengarden.com之类的网站的巨大影响力,以及CSS人士和标准倡导者的极简主义标记美学,改变了我们对标记的思考方式,并且可以通过一些方法实现H1和UL / LI或三个。

In a recent MVC design meeting someone said something like "we'll need a Repeater control" and a powerful and very technical boss-type said:

在最近的MVC设计会议上,有人说过类似“我们需要一个Repeater控件”之类的东西,而功能强大且非常技术性的老板型说:

"We've got a repeater control, it's called a foreach loop."

“我们有一个中继器控件,它称为foreach循环。”

Zing! That's so cool. Get out of my way and let me make some angle-brackets. Again, not for everyone, but for enough people that matters. Open Source projects like MVCContrib and hopefully a bunch of 3rd party component vendor types will drink in that simplicity and the power of statements like that and create helper methods and controls that we want, need and can use, and not just <mvc:TooBigDataGrid/>.

ing! 这太酷了。 别挡我,让我做一些尖括号。 再一次,不是每个人,而是重要的足够的人。 像MVCContrib这样的开放源代码项目以及希望有很多第三方组件供应商类型将以这种简单性和这种声明的力量饮用,并创建我们想要,需要和可以使用的辅助方法和控件,而不仅仅是<mvc:TooBigDataGrid / >。

This is a not just a different tune, but a whole different band playing all new music. Not everyone will like the music, and that's why the world has more than one band. This is a Good Thing.

这不仅是不同的乐曲,而且是播放所有新音乐的完全不同的乐队。 并非所有人都喜欢音乐,这就是为什么世界上有多个乐队的原因。 这是一件好事。

I like to think of ASP.NET MVC as the raw, acoustic version of the more heavily produced and multi-layered ASP.NET WebForms we use today.

我喜欢将ASP.NET MVC视为我们今天使用的,产量更高且多层的ASP.NET WebForms的原始,声学版本。

I hope the pure intent and zen-like simplicity of a nice clean MVC design stays that way. Sometimes I want to listen to Kanye West, but sometimes I want to listen to John Legend. Or, insert your own musical analogy here. Either way, it's ASP.NET Unplugged as far as I'm concerned.

我希望漂亮干净的MVC设计的纯粹意图和类似zen的简单性能够保持这种方式。 有时候我想听听坎耶·韦斯特,但有时候我想听听约翰·莱昂。 或者,在此处插入自己的音乐比喻。 无论哪种方式,就我而言,都是ASP.NET Unplugged。

Related Posts

相关文章

翻译自: https://www.hanselman.com/blog/aspnet-mvc-webforms-unplugged

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值