服务器控件如何违反MVC设计模式? [英] How do server controls violate MVC design pattern?

查看:81
本文介绍了服务器控件如何违反MVC设计模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问的原因是tvanfosson(第一)评论他对另一个
我肯定知道ASP.NET服务器控件,我想我知道MVC设计模式,但是我不明白服务器控制违反MVC。

The reason I'm asking is tvanfosson's (first) comment to his answer to another question of mine where he said (about ASP.NET MVC): "The lack of server-side controls is due to the inherent separation of concerns that makes MVC a good development pattern..".
I surely know ASP.NET server controls, and I think I know MVC design pattern, but I don't understand how server controls violate MVC.

谢谢。

推荐答案

Steven Sanderson的Pro ASP.NET MVC 2框架(第5页)

Found the answer on "Pro ASP.NET MVC 2 Framework" by Steven Sanderson (page 5)


...在现实中,鼓励开发人员混合演示代码(例如,操纵服务器端控制树)与其应用程序逻辑(例如,操纵数据库数据)在这些相同的代码隐藏类中。

没有更好的分离令人担忧的是,最终的结果通常是脆弱和难以理解的。

"...in reality developers are encourged to mix presentation code (e.g., manipulating the server-side control tree) with their application logic (e.g., manipulating database data) in these same monstrous code-behind classes.
Without better separation of concerns, the end result is often fragile and unintelligible."

这篇关于服务器控件如何违反MVC设计模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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