Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If ObjectDataSource isn't the answer for a large application, what is?

Quoting the answer of Andrew Hare on the This Question.

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.

Application Architecture = Maintainability + Scalability + ......

And I think, every article that I've read to start learning application architecture used some classes to build up the business data layer and used ObjectDataSource to connect the presentation layer with the business layer.

Looks like I've got all wrong. What's really the best approach to use for the business layer and its connection with the presentation layer?

like image 614
Mazen Elkashef Avatar asked Dec 20 '10 00:12

Mazen Elkashef


2 Answers

There is no doubt that ObjectDataSource makes the binding process easier.

It handles filtering, paging etc..with less headache.

Points to be considered.

  • View(.aspx) has reference to the Business object so it restricts some of the tasks like Refactoring while the application grows bigger.
  • Many application nowadays use IoC and ODS does not support that.
  • ODS works on parameters and if filter conditions increase we have to increase no. of parameters in the Business which is also not desirable.

So if we consider all these points ODS does not scale well.

like image 173
dhinesh Avatar answered Nov 14 '22 20:11

dhinesh


I don't use the ObjectDataSource; personally, I like the control over the binding process, so I bind directly through the DataSource property, and not use the DS controls. Because the DS controls when to bind or not bind, I dislike tapping into events to cancel binding only because I didn't want to do it at that specific time... It can mask some types of coding blunders, making it harder to debug, but if there is an error, you can tap into the selected, inserted, etc. event and handle the error, I believe.

However, I don't see why its wrong; I am not quite sure why it wouldn't scale well... if it works for you, and when you test the performance is OK, then why not I would say.

HTH.

like image 42
Brian Mains Avatar answered Nov 14 '22 20:11

Brian Mains