Object Relational Mappers are evil (a meditation)

Aaron Watters aaron.watters at gmail.com
Mon Oct 5 10:25:49 EDT 2009


This is a bit off topic except that many Python
programmers seem to be allergic to typing SQL.

RESOLVED:  Using ORMs leads lazy programmers
to make bad database designs.  It's better to
carefully design your database with no invisible
means of support and there is no reason to not
use SQL directly for this purpose.

FOR EXAMPLE:  Consider blogging.  The most
successful blog software is WORDPRESS.  Here
is the WordPress data model:

http://blog.kapish.co.in/wp-content/uploads/2009/03/wp_2.7.png

Beautiful, isn't it?  It was designed by people who
thought about what they were doing and did it carefully.

Now let's look at the Sakai Blogger tool data model
(as reverse engineered by someone who had to
fix a bug -- there actually was no data design created
by the implementers):

confluence.sakaiproject.org/download/attachments/17072138/
entitymodel.pdf

How did the above happen?  I suspect someone opened
up Eclipse and started typing, relying on the Hibernate
ORM to handle all the database stuff automagically.  The
result is a massive headache for people like me.  Another
one.  I routinely open up the mysql prompt and start typing
"show tables", "describe table blah", "select * from blah limit 10"...
trying to figure out WTF Hibernate did with my data.

Occasionally I fantasize about making a non-trivial change
to one of these programs, but I strongly resist going further
than that because the ORM meatgrinder makes it somewhere
between extremely unpleasant and impossible to make any
non-trivial changes to a non-trivial program, especially after
it has been populated with data.

Ok I feel a little better now.  Maybe I should get back
to work...

   -- Aaron Watters
      http://aaron.oirt.rutgers.edu/myapp/docs/W1100_1200.wwiki

===

It has been said that democracy is the worst form of government except
all the others that have been tried.
    Sir Winston Churchill
    http://www.quotationspage.com/quote/364.html



More information about the Python-list mailing list