简体   繁体   English

asp.net回发模型的问题或缺陷

[英]problems or flaws of the asp.net postback model

There are several talks about this issue, but I havent found a clear complete explanation of the flaws of the postback model in relation with other models. 有几个关于这个问题的讨论,但我没有找到与其他模型相关的回发模型缺陷的明确完整解释。 If you think this is a redundant question, and you are tired of these topics I'll understand you vote to close it but what I usually read in articles in internet and here it's the postback model to be mentioned as a flaw of the asp.net webforms model along with others flaws which I understand well (lack of separation of concerns, viewstate, unit testing, etc) but I see no broad, clear and complete explanation of why the postback model in particular is considered bad by many, or I dont seem to completely get it. 如果你认为这是一个多余的问题,而你厌倦了这些话题,我会理解你投票关闭它,但我通常在互联网上的文章中读到的,这里是作为asp的缺陷被提及的回发模型。 net webforms模型以及我理解得很好的其他缺陷(缺乏关注点分离,视图状态,单元测试等)但我看不到广泛,清晰和完整的解释为什么特别是回发模型被许多人认为是坏的,或者我似乎没有完全得到它。 Someone mentioned pages post to itself, other that some pages using the postbackmodel were slower (is this true?) , and I see detailed explanations of how the postback model and other models run, or theoretical explanations that's bad because it doesnt follow such philosophy or model, but not a explicity detailed list of what it makes bad in practice. 有人提到页面发布到自身,其他一些使用回发模型的页面较慢(这是真的吗?),我看到回发模型和其他模型如何运行的详细解释,或理论解释是坏的,因为它不遵循这样的哲学或模型,但不是详细列出它在实践中造成的坏处。 So if you think it would be useful as I think to have such list of items of what it makes it bad in mind when choosing a model for developing, go ahead 因此,如果您认为这样做有用,因为我认为在选择开发模型时会考虑到这些项目的清单,请继续

The criticism is mostly about two things: 批评主要是关于两件事:

  1. Postback makes your programming paradigm stateful and event-driven. 回发使您的编程范例成为有状态和事件驱动的。 The web is actually stateless, page concept is long since deprecated and the word of today is REST. Web实际上是无状态的,页面概念早已被弃用,今天的话就是REST。 Postback makes achieving these goals not straightforward. 回发使得实现这些目标并不简单。

  2. It makes programmers program as though the web is stateful and keep them in the darkness forever. 它使程序员编程好像网络是有状态的,并让他们永远处于黑暗中。 So Windows programmers continue messing with WebForms like with WinForms. 因此,Windows程序员继续像使用WinForms一样搞乱WebForms。 Many ASP.NET programmers with 5-7 years of experience have no idea of how HTTP works. 许多具有5到7年经验的ASP.NET程序员都不知道HTTP是如何工作的。

If you ask why postback is bad as an implementation of an idea to add statefulness to a stateless medium, I have to answer: it isn't. 如果你问为什么回发是坏的,作为一个想法的实现,为无状态媒体添加有状态,我必须回答:事实并非如此。 In fact, it is awesome. 事实上,它太棒了。

If you ask why postback is bad as a concept, then read above. 如果你问为什么回发是一个坏概念,那么请阅读上面的内容。

Maybe you could clarify for us which point of view of presumed badness interests you. 也许你可以为我们澄清假定的不良观点对你的看法。

WebForms is a lie. WebForms是一个谎言。 It's abstraction wrapped in deception covered in lie sauce presented on a plate full of diversion and sleight of hand. 这是一个欺骗性的抽象包裹在谎言的酱汁呈现在一个充满分流和手法的盘子上。 Nothing you do with Webforms has anything to do with the web – you let it do the work for you. 您对Webforms所做的任何事情都与Web无关 - 您可以让它为您完成工作。

Source: Rob Conery 资料来源: Rob Conery

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

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