tags:

views:

239

answers:

4

I read there is a debate here http://blogs.objectsharp.com/cs/blogs/barry/archive/2004/02/10/273.aspx

Why the debate ? Dataset for me is like relational database, Object is a hierarchical-like model, why do people absolutly want "pure" Object model whereas we still deal with relational database so why not combine the two ?

And if yes is there any LEIGHTWEIGHT COMPREHENSIVE framework (not heavy mammouth like Nhibernate which takes a huge learning curve) that allows to do that ?

+4  A: 

"Pure objects" are a lot easier to work with, the typed object gives you intellisense and compile-time type checking.

Bare datasets are very cumbersome and annoying to work with - you need to know the column names, there's no type checking possible, so if you mistype a column name, you're out of luck and won't discover the error until runtime (the worst possible scenario).

Typed datasets are a step in the right direction, but the "things" you work with in your .NET code are still tied very closely and tightly to your database implementation - not typically a good thing, since any change in the underlying database might affect your app all the way up to your UI and cause a lot of changes being necessary.

Using an ORM like NHibernate allows you to better abstract and decouple the database (physical storage) layer from your logical business model - only in the simplest of scenarios will those two be an exact 1:1 match, so you'll need some kind of "translation" or mapping between the two anyway.

So all in all - using typed datasets might be okay for small, simple apps, but for a challenging, larger-scale, enterprise-level business app, I would never recommend coupling your business object model so closely and tightly to the database.

Marc

marc_s
A: 

why do people absolutly want "pure" Object model

Because you don't want your application to depend on the database schema

Yassir
A: 

Well, all the reasons you give were the same as the academical reasons that were given for EJB in Java which was a mess in the past. So arent't people falling into another fashionable hype ?

As I read here: http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx

the promise is one thing, the reality is other thing.

Where is the proof upon the claims ?

Scientifically, Complexity is tight to the Concept of Entropy, you cannot reduce the inherent complexity of things, you can just move it somewhere else, so for me there is something fundamentally irational.

programmernovice
Yes, of course - you can't magically make complexity disappear - but using a clear, layered approach and the tools to support it (OR-mappers), you can make it more manageable. It's still complex - but you can manage it a lot better if you can change one layer independently from another. With typed or untyped datasets, a single change in the database can bring the whole app down - been there, seen that - trust me.
marc_s
Ted Neward's blog post on ORM being the "vietnam of computer science" is highly controversial - I for one do not agree at all with what he says in it. So you can't take that as proof or fact - it's his opinion, to which he's totally entitled - a lot of other folks have other opinion and can express those much better than I can
marc_s
But hey - there's nothing and no one stopping you from going out and using typed datasets in your applications. Lots of other folks do it - with more or less success and more or less maintenance pains - but if you feel more comfortable with that approach, by all means, use it!
marc_s
A: 

Ted Newards is highly controversial because it seems to me that everybody is herding like in the old EJB days: nobody dared to say EJB suck until Rod Johnson gets out with Hibernate.

Now it seems nobody cares to say ORM frameworks like Hibernate, Entity Framework, etc. are too complex, because there isn't yet another Rod Johnson II maybe :)

You pretend that adding a new layer solves the problem, it's not always the case even theorcially, like adding more team members when a project becomes a mess because adding more programmers also mean add to coordination and communication problem.

And in practice, what it seems, is that the layers that should be independant at least from the GUI viewpoint, aren't really. I see many people struggle to do simple stuff in the GUI when they use an ORM.

programmernovice
No, I'm not saying adding layers SOLVES the problem - it makes it MANAGEABLE
marc_s
And I see lots of people struggle in their GUIs because they use a very direct, very immediate link to the database, and any little chance breaks their GUI........
marc_s
There's pros and cons for each solution - pick the one you prefer, and use it.
marc_s
No one is forcing you to use an ORM if you don't want to. But a lot of folks have built systems on direct datasets and suffered the maintenance pain and nightmares and have chosen another path.
marc_s
I don't understand why you say using datasets is a direct link of GUI to database since Dataset is a layer that isolates from the physical database and you can make things database neutral by putting connection string in a config file.
programmernovice

related questions