Blog Stats
  • Posts - 62
  • Articles - 1
  • Comments - 32
  • Trackbacks - 64

 

I'm sure I don't get it about the ObjectDataSource control

I guess I'm confused about the ObjectDataSource control. the SqlDataSource control is a non-issue for me since I'll *never* build an app that puts a view dependency on my database schema, but I see alot about the ObjectDataSource control in the Nhibernate forum.

It's been a while since I actually wrangled with the ObjectDataSource control since I didn't see what advantage trying to get it to wireup to my model this extra control would bring to the table. What is so different about simply binding to a Repeater control? Two-way binding I suppose is the answer, but typically I communicate with a service layer on top of my domain entities since I rather protect my domain entities from upper layers, so by the time i get done wiring up the CRUD events in these new ASP.NET 2.0 controls, did I save time from simply iterating over a repeater and passing the values to the appropriate service for processing?

I'd love to see know what I'm missing since so many developers seem to be spending time extending these controls that, at least from what i can tell, expose an app's Domain layer to bad practices and creates rigid dependencies between the view and it's data source.

What you tink sensei?


Feedback

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Mike,
Here's the scoop: the SqlDataSource is around for new developers to use to click and build their applications and for M$ to demonstrate how you can create an app in 5 seconds. The ObjectDataSource was created for those develoepers that have graduated from the two-tier click and build design but still aren't quite ready for a nicely separated, abstracted, loosely coupled (over architected :) design.

We can only look down on them and fondly remember when we were so naive and help them along by writing excellent posts on Visitor Patterns, MVP, and Domain Driven Design.

Keep the faith. 9/12/2006 3:42 AM | Bill Pierce

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Bill you are cracking me up! I certainly didn't mean to sound snobby if I did...I am not meaning to look down on anyone at all! Does this mean that you don't use these controls and have found them useless too?

I just want to make sure I am not missing something in my toolbox.
I've just seen alot of people creating custom controls around these DataSource controls to do tings like, say, sort...Why delegate CRUD functions to a control when you can just do that in something like a service layer or something and then get code reusability? 9/12/2006 7:47 AM | Mike

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Hey Mike,

I think that the at the end of the day it comes down to the fact that a large percentage of developers are still very comfortable with the drag and drop approach to application development, and have not yet seen the value that applying some of the concepts such as patterns, test driven development and domain driven design can bring.

I took a look at the object data source control, and then continued to write an article describing exactly what you were saying. If you have gone to the trouble of introducing a rich domain with at least a presenter (maybe not a service layer), is there really any advantage that the ObjectDataSource control brings? I don't think so!!
9/14/2006 11:17 AM | Jean-Paul S. Boodhoo

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Good to hear...thanks for the thoughts Jean-Paul :) 9/17/2006 6:09 PM | Mike

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Ditto.... ODS is teh suck. I have tried to conform my object model a few times to use it and it's cumbersome and ugly and provides little benefit. 9/19/2006 6:11 AM | Ben Scheirman

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Glad I'm not the only one coming to the conclusion that the ObjectDataSource control is pointless. 9/25/2007 2:47 AM | Dave

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar Mike ,
I hear alot of talk on blogs and forums about the problems with the objectdatasource. What methods do you use to display the data on web apps from an oop approach? 12/27/2007 7:05 AM | Rafiq

# re: I'm sure I don't get it about the ObjectDataSource control

Gravatar I completely agree with your review of the ODS control. It - like several other controls - do little more than encourage bad application design, or lazy application design at the very least. 7/7/2008 2:02 PM | Brian Whittington

Post a comment





 

Please add 2 and 6 and type the answer here:

 

 

Copyright © Mike Nichols