Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The new database layer is... nice-ish, but what ever happened to Dries Buytaert's prediction/dream of finally having an object-relational mapper in Drupal (http://buytaert.net/drupal-predictions-for-2008)? Last I heard was that a Doctrine integration got rejected chiefly because "it would slow Drupal down".


ORMs are nice for simple things, but once you get to a system with a decent amount of complexity they really start to fall down. Case in point, doctrine has a custom query language to deal with a lot of the complexities. This is actually the reason behind the slowness you pointed out.

Thankfully, there is the entity system which for all practical purposes is an ORM on steroids. It abstracts storage away from the developer, has attachable fields with per field storage configuration. Plus every entity has a completely customizable controller class. There are now modules that give you an entire controller architecture (http://drupal.org/project/entity). I think it's a pretty cool idea and blasts ORMs out of the water.


I'll take anything over the pre-7 approach of either extending nodes, trying to wrap your head around programmatically using CCK or doing plain SQL... but an ORM on steroids? The code samples on http://www.istos.it/blog/drupal-entities/drupal-entities-par... aren't exactly what you'd call elegant, bundles are a poor man's inheritance, you need a contrib module (Relation) to do something as basic as relations, and EntityFieldQuery doesn't even come close to the expressiveness of e.g. SQLAlchemy. It's an enormous step forward, but don't get cocky :-)


Doctrine is brutal. Massively bloated, extremely slow, and feels (in general) like a cluster-f*.

I like ORMs, and you can make them fast and effective. But in PHP, lightweight is king. I personally wouldn't go with anything beyond what's found in CodeIgniter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: