3 ms·
Because you can't cleanly map objects to sets nor sets to objects. Sure, if you want to pretend an RDBMS is an object store you certainly can, but you'll be for
by sjwright 13y ago
Because you can't cleanly map objects to sets nor sets to objects. Sure, if you want to pretend an RDBMS is an object store you certainly can, but you'll be forced to have an incredibly stupid schema, and will miss out on much of the benefits of a good RDBMS.
Turning a powerful SQL database engine into an object storage emulator is just sad.
If your underlying data suits objects better than sets, consider using something that's designed for the job, like one of the many non-SQL database systems.
Although it may seem trite to say it, Object/Relational Mapping
is the Vietnam of Computer Science. It represents a quagmire which
starts well, gets more complicated as time passes, and before long
entraps its users in a commitment that has no clear demarcation
point, no clear win conditions, and no clear exit strategy.
http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Compute...
Well worth reading.
Also:
http://database-programmer.blogspot.com.au/2010/12/historical-perspective-of-orm-and.html http://database-programmer.blogspot.com.au/2010/12/historica...
http://www.codinghorror.com/blog/2006/06/object-relational-mapping-is-the-vietnam-of-computer-science.html http://www.codinghorror.com/blog/2006/06/object-relational-m...
- jpatte 13y agoUnfortunately I didn't have time to read these articles in depth, nor do I have the time to write a detailed answer now - sorry. But it seems to me that the situation has changed since these articles were written, at least concerning the tools I know best (which are .NET and C#). We now have built-in support for data (sets) manipulation in C# and Entity Framework makes things like db.Customers.First().FirstName with syntax support totally real. Many of the premises these essays seem to be based on (like "the languages in play lack any real specialized data structures") are just not true anymore. Also, I would like to know more about why using an ORM like EF would force me to "have an incredibly stupid schema".
- mindcrime 13y agoTurning a powerful SQL database engine into an object storage emulator is just sad. Now that I can agree with, but I would consider that to be a (subtly, perhaps) different position than: "ORMs are inherently stupid". IF you have the option of choosing a native object store for persisting objects, then - by all means - choose it. But in cases where an RDBMS is the data store of choice for whatever reason, and you still have to store your objects there one way or another, I'd prefer using an ORM like Hibernate over hand-rolling all the low-level SQL/JDBC code to marshall objects back and forth between the DB.
- deleted 13y ago[deleted]