我为我的客户提供了一个业务逻辑层对象。它有很多不同的字段,大约 100 个:Id、Name 和其他字段。
我正在通过数据网格(RadGrid)检索客户。显然,在网格中我只是检索一些字段。
问题是:如果业务逻辑层对象的字段太多,即使我不在数据网格中显示所有字段,是否会减慢页面速度?您认为为我的客户创建另一个列表对象是个好主意吗?
谢谢
I have a business logic layer object for my customers. It has a lot of different fields, around 100: Id, Name, and other fields.
I'm retrieving the customers un a data grid (RadGrid). Obviously in the grid I'm just retrieving a few fields.
The question is: if the business logic layer object has too many fields, even if I don't show all of them in the data grid, is it going to slow down the page? do you think it'd be a good idea to create another object for my customers for the lists?
Thanks
发布评论
评论(1)
填充服务器端列表将花费额外的时间,但关键的考虑因素是传递到客户端的数据量,特别是数据的副本也可能进入视图状态,并且在提交表单时该数据将返回(通过视图状态)
您可以在业务对象上使用 LINQ 来减少转发的数据量,而不是创建新对象。
It wil take extra time to populate the server side list, but the key consideration is teh amount of data passed to the clinet, especially as a copy of the data will probably go into viewstate as well and when submitting the form this data will come back (through viewstate)
Rather than create a new object you could just use LINQ on you business objects to reduce the amount of data to pass forwards.