对象数据源或代码隐藏:哪个更好? [英] Object datasource or code-behind: which is better?

查看:129
本文介绍了对象数据源或代码隐藏:哪个更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个可以引起很多争议的主题,但我想知道人们认为使用对象数据源的各种利弊。我现在正在和另一个程序员进行一个项目,他的经验和舒适度都是植根于经典的ASP,而且我不确定哪种方式将要

a)快速完成工作
b)用最小的功夫完成工作



我们有一个很好的存储库层,域对象能够进行自我验证,所以方法可以做到ODS绑定或代码隐藏绑定。



我不喜欢ODS的大部分明显的原因,但如果这样做可以节省我手写代码分页/

解决方案

对象数据源很适合小项目,但是在将数据层信息嵌入到应用程序的UI层中时,它们不会很好地扩展。我建议您只将它们用于非常小的应用程序和划痕测试的东西。如果您作出设计决定,使用它们将准备好与未来的扩展和维护问题进行斗争。


I know that it's a subject that can raise a lot of debate, but I'd like to know what people think the various pros and cons of using Object Datasources are. I'm doing a project right now with another programmer who's experience and comfort level are all rooted in classic ASP, and I'm unsure of which way is going to
a) get the job done quickly b) get the job done with a minimum of fuss

We have a nice repository layer with domain objects capable of self-validation, so the methods are in place to do either the ODS binding, or code-behind binding.

I dislike the ODS for most of the obvious reasons, but if it does save me from having to hand-code paging/sorting/selecting/inserting/updating/deleting scenarios, then can it really be that bad?

解决方案

Object data sources are nice for small projects but they do not scale well as you are embedding data-layer information in the UI layer of your application. I would suggest that you only use them for very small applications and scratch-pad testing stuff. If you make a design decision to use them be prepared to struggle with scaling and maintenance issues in the future.

这篇关于对象数据源或代码隐藏:哪个更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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