DataSet is not ORM but it is possible to build an ORM with Dataset http://www.15seconds.com/issue/080103.htm
This kind of article is very rare as people seem to oppose Datasets and ORMs so any other example ?
DataSet is not ORM but it is possible to build an ORM with Dataset http://www.15seconds.com/issue/080103.htm
This kind of article is very rare as people seem to oppose Datasets and ORMs so any other example ?
An ORM is a fundamentally different thing than DataSets.
DataSets are very much a 1:1 copy of your relational database tables in memory; a DataSet contains multiple DataTables, each made up of columns and rows. It's more or less a "relational database in memory" - no mapping, no translation - just a 1:1 copy.
All good and fine if you're comfortable with working in this column/row style (which works for many cases).
An ORM is a totally different beast - as the name says, it's an Object-Relational Mapper, e.g. it maps those relational columns and rows into domain objects and collections thereof in your domain model. It does a mapping between columns and rows into collection of objects with properties.
You're no longer dealing with a customers table, but instead you're dealing with customer objects, lists of customers and so forth. You're programming against a "normal" business object, and the ORM will take care of mapping that to tables and columns and rows for you when you save it.
Since the DataSet is more or less a 1:1 copy of your database, you could in theory put an ORM on top of that to get objects from it - but what's the point? Why even go the route of having a DataSet in the first place, when you want to use an ORM in end anyway?? I don't see any benefit in that approach...
Explain to me (and the other Stackoverflowers) why you want to use DataSets and an ORM on top of that? What's your goal, what's your idea / approach??
So it's really about choosing between DataSets or ORMs - either will work, either caters to a different programming and architecture style. Pick yours and be happy with it.
Marc
I agree with marc_s's comments.
The article which you refer to appears to be a bit dated. It is trying to use a Dataset as an ORM tool, at a time when the availability of ORM tools was more limited than it is now.
I would recommend that you look at Entity Framework (an ORM), it supports the active record pattern, as well as having UI tools similar to datasets. If all you do is auto-generate your entities based on your database, you may not notice a big difference from using datasets.
http://msdn.microsoft.com/en-us/library/aa697427%28VS.80%29.aspx