Blog Home  Home Feed your aggregator (RSS 2.0)  
ObjectDataSource limitations, problems and possible solutions - Manuel Abadia's ASP.NET stuff
 
# Friday, March 10, 2006

In the past weeks I've been posting some detailed information about how the ObjectDataSource works in ASP.NET 2.0. Here's a summary of what was posted:

Part 1 - The basics

http://www.manuelabadia.com/blog/PermaLink,guid,c72852ae-1fdd-4934-a715-f565ceaf21cc.aspx

Part 2 -  Paging, Sorting, Parameters and Events

http://www.manuelabadia.com/blog/PermaLink,guid,f002752d-1258-475d-9ec0-eee3bd98d0a4.aspx

Part 3 - Optimistic Concurrency, parameter merging, caching and design time attributes

http://www.manuelabadia.com/blog/PermaLink,guid,eaa3eed8-f997-43c4-8c30-78c2f72d0c86.aspx

In those posts I pointed out some limitations or problems with the ObjectDataSource control. The only real solution here its to code your own data source control but it isn't an easy task. 

I'll summarize here the most important problems/limitations of the ObjectDataSource IMHO:

* Having to write a SelectCountMethod when your data source does support paging.

* All calls to the methods specified by the XXXMethod properties are made using reflection but the reflection data isn't cached so for medium/big applications this could be a bottleneck.

* It can't be extended without having to rewrite almost all of it.

* The control can't be used in some cultures because of the conversions from that it makes using the invariant culture instead of the current culture.

* The AffectedRows property is very important in order to get the GridView working properly so it's a pain to have to handle the inserted, updated and deleted events every time you use the ObjectDataSource.

* Filtering support is minimal and reserved only if you return a DataSet, DataTable or DataView.

* The cache doesn't support neither filtering nor paging.

* If you're using custom objects you can change the parameter dictionary for the insert, update or delete methods.

* There's no source code available to make little tweaks to the ObjectDataSource in order to adapt it to how you work instead of you adapting of how it works.

As I was very unhappy with the ObjectDataSource I coded my own data source control based on the ObjectDataSource but with a lot of improvements. As this wasn't a trivial job and required quite a few time, I decided to spend some more time on it to make it a commercial product. Take a look here for all the features of this new data source control:

http://www.manuelabadia.com/products/EODS_features.aspx

I have to remark that the control was designed to be very extensible so if you ever wanted something more than the ObjectDataSource you could save yourself typing and testing more than 10000 lines of code:

class diagram

 

I hope you find it useful. Feedback is welcome.

Update:
You can access to the other parts here:

ObjectDataSource in Depth (Part 1)
ObjectDataSource in Depth (Part 2)
ObjectDataSource in Depth (Part 3)

Copyright © 2014 Manuel Abadia. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.