Re:ORM is an anti-pattern
by smharris65 on Saturday September 17, 2011 @09:46AM
(#3007989)
Good point. Maybe you have to choose a tool that allows you to discard it if you find a better tool once the problem becomes clearer. So, the question is: are ORMs easy to "unplug" if you need to use a better tool?
The problem with unplugging the ORM or inter operating is that the 2 biggest ORM frameworks are implemented such that they don't support composite primary keys and have stupid requirements like having an auto increment column called "id" on every table (including tables used as part of a many to many relationship!!).
As far as I know Doctrine 2.0 absolves a lot of these problems but I've not used it yet.
If the requirements change outside of the scope of the ORM you can always write SQL to do the query or guide the ORM.
If the requirement change requires a different backend using an ORM is actually easier, faster and less error prone.
So yes.
Application requirements may sometimes provide broad limits for technology choices but the link isn't very strong as there is a huge gap between the problem space and the solution space (evidenced by the army of software developers needed to translate between the two)
Software is not hardware and it's not even engineering in my view. The extent to which we in the software space are able to define and redefine jobs as well as tools makes this kind of thinking useless.