From: Phillip Gawlowski Date: 2010-11-13T15:39:16+09:00 Subject: Re: ORM's - Don't Do It! On Fri, Nov 12, 2010 at 9:56 PM, Petite Abeille wrote: > > On Nov 12, 2010, at 6:18 PM, Phillip Gawlowski wrote: > >>> Databases have a wealth of logic, elegance and functionality. Slapping >>> them in the crude harness of ORMs is a most unfortunate and regressive >>> trend. >> >> Why? > > Why not? It's impolite to answer a question with another question. ;) > An oldie, but a goodie :) > > "The Vietnam of Computer Science" > http://blogs.tedneward.com/2006/06/26/The+Vietnam+Of+Computer+Science.aspx So, the very first argument against ORM is... turf wars. That's not a problem any technology can solve, since it is an organizational issue. And all other arguments are pretty much balanced out by the simple fact that encapsulating a database schema in a way that fits naturally with the language used (so, objects for object-oriented languages) improves productivity, and doesn't lead to overhead by having to switch from, say, C# to SQL every time. And *of course* the impact of any given tool, technology, methodology has to be evaluated before you invest in it (that's where the Vietnam War analogy breaks down, and breaks down hard). But that's where ORM can be a benefit: The developers don't have to *care* about the database stack, since they don't have to deal with it. The ORM library takes care of talking to databases. In short: no technology is inherently evil or bad. It's either used appropriately, or not. > "Do not build applications that enable you to switch your DBMS, instead, build applications that enable you to switch the 'du-jour' technology" Dear Lord. Yes, build your tools in such a way that you *are not dependent on any single piece of technology*. That's easier in some cases (an RDBMS can be exchanged relatively easily), and much more difficult in other cases (changing from .NET to Java will require a rewrite of the code). Not to mention that ORM can provide the necessary abstractions to be able to switch from, say, from SQL to NoSQL databases, so you aren't stuck in the "technology du jour". -- Phillip Gawlowski Though the folk I have met, (Ah, how soon!) they forget When I've moved on to some other place, There may be one or two, When I've played and passed through, Who'll remember my song or my face.