Published by Fabian on 15 Sep 2007 at 12:35 pm
There is some discussion in the symfony which is the better ORM layer. Propel or Doctrine.
To be honest, I prefer Propel right now. It is simple, you can easily override functionality (even when its ugly by copy pasting just to force a certain PK to be set). But the best thing is the availability of behavior plugins from the community.
The Plugin-Wiki hosts currently 17 propel plugins. And those are growing from day to day. You might say, oh well why do i need to add a plugin to be able to rate one of my domain objects?
The answer is: You don’t need. you can code it yourself. But why would you, if you get a maintained flexible and readymade plugin for it? Actually I switched from a home grown rating solution to that plugin and contributed my ideas. It is more powerful, more robust and more structured than the solution I came up.
Here my top 3 of the propel plugins:
- sfPropelActAsNestedSetBehaviorPlugin : Have you ever tried to build a tree from an RDB? It is a hell of work and this plugin solves this like a charm. There are many improvments discussed on the mailinglist and constantly integrated. This plugin saves you A LOT of work.
- sfPropelActAsRatableBehaviorPlugin : As described above. This helps you rating your domain objects. It includes a module for displaying a star rater plugin.
- sfPropelActAsCommentableBehaviorPlugin : Pretty new plugin, but similar to ratable. But only for comments. As ratings and comments are two main features of modern web 2.0 apps this is a must too. Again: Not complicated to do yourself, but a solution that is maintained enhanced and gets features you would have liked but not thought of yet, is much better than reinventing the wheel.
Have a look at symfony plugins today. Don’t reinvent the wheel, but contribute to make existing wheels even rounder!
I just checked how you would do these behaviours in propel. pookey pointed me to something Doctrine calles templates:
this should be pretty much similar to behaviours. Although there are no readymade symfony plugins for common use cases existing yet. Hope that helps you Doctrine users. I am not (yet) one