对于数据绑定在asp.net中可维护性最佳实践 [英] Best practices for DataBinding in asp.net for maintainability
问题描述
我想知道什么是使用asp.net数据绑定,在可维护性方面的最佳实践。
I would like to know what are the best practices for using asp.net DataBinding, in terms of maintainability.
我不希望应用程序下跌APPART时,我必须做出改变到数据库。
I don't want the application to fall appart when I have to make changes to the database.
我应该完全数据绑定在codebehind?我打算用ObjectDataSources的数据绑定。有一些更容易维护比使用数据绑定,如果是这样,是什么呢?
Should I databind completely in codebehind ? I am planning on using ObjectDataSources for the databinding. Is there something that is easier to maintain than using databinding, if so, what is it ?
有没有考虑,设计我的数据访问层和我的业务层时,我应该考虑到?
Are there considerations, I should take into account when designing my data access layer and my business layer ?
感谢。
推荐答案
我对这个理念是,数据访问的东西没有业务的标记。对象数据源是优于SQL数据源,但我想保持我的标记,因为只有将坐上去的页面呈现的东西。我也preFER你有什么样的东西是数据绑定,你总是从从背后code做得到控制。
My philosophy on this is that data access stuff has no business in the markup. Object Data Sources are better then SQL Data Sources, but I like to keep my markup as only stuff that will get rendered on to the page. I also prefer the control you have on what stuff is databound that you get from always doing it from the code behind.
这篇关于对于数据绑定在asp.net中可维护性最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!