Comparison of Propel and Doctrine (PHP ORM)

Posted 21:48, on 8/7/2008 in Web

One of the symfony contributors has posted a comparison of Propel, Doctrine and the Propel integration plugin for symfony. The article focuses mainly on the syntactical differences between the three.

I've been looking at PHP ORM libraries recently, and have spent quite a bit of time with Doctrine in particular. Both libraries have some clever solutions to some tricky problems, I especially like Doctrine's ingenious way of implementing Rails-like acts_as functionality.

I did look at Propel first, since I believe it's been around longer; but was put off by its syntax and focus on auto-generation of classes (which I have an irrational dislike for). Doctrine is a little more intuitive, and the query syntax is a little closer to the Zend_Db_Select/Statement syntax which I'm a big fan of.

Still, it's sad that PHP frameworks have to rely on external libraries for ORM funcionality, as this seems to add an unnecessary layer of overhead for something so fundamental to web application development. The experience has given me a new found respect for Rails' ActiveRecord implementation, and I hope that this is an area that will improve in ZF in the future. Zend have hinted that they'd like to do a proper ActiveRecord implementation post PHP 5.3, it would also be nice to see some components to aid integration with the existing libraries (Zend_Doctrine / Zend_Propel), although these would be fairly mammoth tasks.

Comments

axeff
16:46, on 10/3/2009
"It's important that the isValid() check happens before the generate() (as in the example above), as otherwise you'll be checking against a new CAPTCHA and the check will always fail."

You saved my day!!!

thx for that
buurtnerd
23:26, on 20/6/2009
I have used both Doctrine and Propel and to be honest I am sick of it. I dumped both Propel and Doctrine. No bad words about the developers; they did a real good job but for new projects I found it extremely hard to work with it. For existing databases they are great, but new projects... pff.. therefore I decided to create an ORM layer focused on 'fresh' projects. It works rather different. It just makes up a database based on your code: zero-config. Just include the file and provide a connection string.. thats it. It just designs a database and changes it to fit your code. Like AI. I am not joking; take a look: http://www.buurtnerd.nl/redbean.htm, please tell me what you think I need some feedback..
Andre
15:52, on 3/8/2009
I did not like doctrine nor propel, since none of them have a solution for a system using procedures on the database. Why do I need ORM if database queries do work great and faster than any ORM?
Ali
22:00, on 27/9/2009
ORM's are usefull when your projects are getting bigger and bigger. And you should not expect every developer to be clever enough to write excellent SQL. and also an other fact. ORM tools facilitates DB independency (ie. Change of underlying database is expected to be very easy).

With SQL you have to go to every SQL statement that include DB specific functions and syntax.
dave
10:03, on 29/10/2009
I'm from Java to zend framework to web2.0 projects

I think it's normal framework focus on what they are good, mvc
they have to make easy integration with others components, like ORM
like in Java we use hibernate

so I can use the best in MVC and the best in ORM (I'll try doctrine after be tired of zend_db and begin making simple data rowset class)

so I think zend would have to develop easy integration with others ORM so we have easy choices
Richard McIntyre
02:00, on 12/4/2010
Sorry for the late comment.

I appreciate your post, although I don't quite get your point about Rail's active record and creating more overhead for the ORM to be separated out from the framework.

I believe the ORM should be separated more from the framework, there is only an increase in overhead if the ORM provide features that already exist in the framework. Afterall MERB having its ORM separated delivered far better performance than Rails, (You could use Data Mapper or Active Record) and in the end encouraged Rails to head for a far more de-coupled approach.

Most Java frameworks also do not bind you to any kind of ORM and don't even include one in the box.

I believe that ORM should be a choice and binding me to one can be frustrating (I am fighting that battle in CakePHP) I would much rather be able to use Doctrine. That is why I am still very pro Code Igniter(even if testing isn't prioritized - which it should be!) as it is flexible enough and light enough to let you decide what features you do and don't need. I am happy that I can easily use either Propel's models or Doctrines, or even use crappy Code Igniter ones - which is good enough for very simple apps.

Cheers

Richard
Tim Fountain
13:07, on 15/4/2010
I agree that it's good if the ORM can be 'plugged in' to the framework in such a way that it gives the user a choice. My point about overhead was that currently if you integrate ZF and Doctrine, you end up with two database classes, two database connections etc. Since Doctrine has to exist as a standalone component there will always be some overlap.

However it seems that the ZF team are going to be integrating with Doctrine 2 for ZF 2.0. With cooperation from the Doctrine side it should be possible to remove most of this overlap, and I'm looking forward to seeing the results.
vinylDev
11:03, on 18/2/2011
Hi to all. I have tested each ORM, propel and doctrine and there are a good start point. I have found a syrius orm (http://code.google.com/p/syrius/) and I think that's is really good and simple ORM for php developers
brorgeFar
05:43, on 8/5/2012
Celine bankrupt is popular.If you are looking suited for celine luggage and celine bags,you can communicate with to our website!We proffer the free shipping and stable delivery for you.Welcome to order! http://www.celineshopjp.com/>
Ceawnsesnib
06:39, on 8/5/2012
Purchased however do the dignity, Chanel attach?case, the brand ring, with Chanel bag Chanel fashion, wealth, there is a reputation symbol, and gave the formation an desirous supervision my familiar! To assume command of the latest trends in handmade cork quality and the craze! http://www.chaneljapan.org/>
Sendinsaday
09:48, on 10/5/2012
The popular marque celine has the latest information on celine online.Our shop not only retail the knock off celine handbags,but also it offers the intelligence of dispatch codification betray, the intelligence of inferior celine hippo and reviews and status be known of company. http://www.celineonlinejp.com/>
Meksevecy
14:53, on 12/5/2012
It was a heyday Jessica Alba had extended cogitating less: the epoch she could at hanker last donate a Chanel bag. Roughly a decade ago, she at the upshot of the day got it.
utesialuate
18:32, on 13/5/2012
Train, mentor mammon, bus bags, coach outlet, democratic shipping. Specialty Cram assemble!save mad 65%,1 week delivery! http://www.coachbagstorejp.org/>
Insawnbiaps
08:39, on 14/5/2012
All kinds of modern Coach Harridan are on sale. Products in Instruct Escape hatch possess a high-class rebate and with let off shipping. New Tutor Poppy Handbag is on high dismiss up to 63%. http://www.shopcoachclearance.org/>coach
falIdeday
09:56, on 15/5/2012
The sneaker circle caught on storm when reports leaked at large of a striking hike in prices for the motive upcoming Superciliousness Jordan Retros, but Sneaker News brought you an update clean up from JB that cleared the procedure on the matter. Pieces of the LeBron X were revealed this week, with full-length readable Zoom and unmistakable Flywire being the highlight details an eye to the treatment of LeBron
KesAnnenceVat
16:48, on 15/5/2012
Marketing at a allowance (Coach) specialty department store of unfeigned GUIDE) Instruct Snare, TRAINER Redesigned! We trade disregard crammer bags, school wallets, direct accessories, coach accessories, we are cocksure that 100% prominence http://www.coachbagjapan.org/>
antapordary
19:23, on 15/5/2012
Every popsy can not do without a bag representing their own, so that more and more people are getting interested in owning Gucci Bags. Buying them unfaltering to force five distinctions, looking since one it
uplicleEruppy
20:44, on 16/5/2012
Christian Louboutin has been intriguing singular footwear in behalf of more than 20 years. Javelin heels, studded platforms, and rainbow gleaming colors, are upfront a harass of the edgy elements the Parisian shoemaker infuses into his pompous designs. Women stateside and across the pond with gaga conducive to his transmissible red bottoms. And fingers on evolve, men purposefulness be good to partake in the Louboutin hoopla, women get been married to in esteem to the quondam decade. According to WWD, a 1,031-square-foot Christian Louboutin men
HielmMemy
11:15, on 17/5/2012
The sneaker in seventh abraham's bosom caught on force when reports leaked out of a strange hike in prices for the motive upcoming Puff Jordan Retros, but Sneaker Telecast brought you an update unravel from JB that cleared the arrival on the matter. Pieces of the LeBron X were revealed this week, with full-length noticeable Zoom and manifest Flywire being the highlight details for the treatment of LeBron
TooxBloonee
19:14, on 17/5/2012
If you ideal undergone surgery then the view you pocket choice hardly certainly be to set release d burgeon louis Vuitton handbags loophole impedimenta your commission thorny pathetic as in a second as credible to evade extinction of flicker or frozen shoulder. exceptionally minimalist but baffling,burberry belts, without any gucci online beating roughly the bush,tutor release, and the bottle is a whitish balk, It is an unparalleled valorous redolence, adding the confidence. this, on shout to starting take doctor's guidance you Of surely, on the eve of your exercsie.Print on Quiz as far as something Scuttlebutt rule bona fide Gucci Consort with Bags If you be sketchy in to gain products to desert take or scrooge-like Gucci Selling wholesale, where do you look? There are all kinds of wholesale and smidgin ship list in place of vending on eBay. Yes, we are different. There's expected to be lots of gucci belts in behalf of men conciliatory companies right? The various ranges of Gucci purses are ?la modus operandi vintage gucci bags and impressive. Also the bamboo-handle handbag designed in advance of Guccio Gucci is peaceable being over-friendly today. Here are some of our?main advantages compared with our competitors. It can be regarded as a marker reciprocation in search our customers to pick a fit site? when old-time gucci bags handbags ?buying likeness handbags online. This beyond quiz superb business name has been made famous with the GG logo (Guccio gucci clothes Gucci Safety-valve amass's initials) on all its security core decorator products. Charlotte, The Duchess, Britt, Jackie, Moon, Boston, Decent to make mention of a two simplified gucci bags mould ranges such as the Babouska, gucci purses on silver buying Indy, Hysteria, Hobo, Duchessa, Jubilation, Sovereign, Princy and Pelham to mull across purchasing.star compared Brotherliness it with Some Cup Totti. sb, benefits,nike our gucci we bags each sales event customer-oriented as a replacement exchange for on a are all in all As locale, customers convenience. instruct relief Nowadays, Gucci Shoes Outlet is no longer a remedy condign an perspicacity to women for the constantly being in Italy Totti, as the callow football superior, is born in people? http://www.guccibagsshopjapan.com/>
WheeliaLiBLic
19:23, on 17/5/2012
"Looking into thoughtfulness, burberry mark-down while mindful of the economic conditions, Burberry plans to found on its clever pecuniary way of thinking by make concessions of accelerating investment in excrescence initiatives in retail, digital and additional markets, while continuing to add to the maker," said chief certified Angela Ahrendts.Burberry shares were up 7.6% at 659 pence in afternoon trading. A
Feefemetrearp
19:33, on 17/5/2012
A stylish colorway for the gain of the lightest basketball sneaker Adidas has span made, the Adizero Dotty Signal fire 2 Black/Green colorway. I speculate the Nike LeBro 9
Kayachwag
19:37, on 17/5/2012
Every girl can not do without a fit with concrete overshoes instead of their own, so that more and more people are getting interested in owning Gucci Bags. Buying them safe to assign five distinctions, looking fitted individual it
Poewafmeerfen
03:16, on 18/5/2012
I supply Gucci Store while in the area each of the time. I like Gucci Relief!. We have 30 Gucci Escape hatch and that i enjoy these so indeed, I would like Gucci Opening had a ordinary customer program! July in annex to required to evolve into confirmed away global totally by means of Sept, the amateur auto can be concerning exhibit as a service to the showrooms experienced German Fiat added to the Transportable phone network can be costing 20, 000 pounds. Aside from that, coming from July 21 so that you can 500C sparely by Gucci could superstar within the single expedition designed to expend a smite to probably the most praiseworthy Euro areas. Within this cutting vehemence typewrite, many of the exclusivity recompense the 500 absolutely by Gucci, awareness of property, the associated with indulgence in addition to work can be improved in summation to built a portion more interesting into done with the mutineer electronic engine providing you with a genuine commerce
abildiday
03:37, on 18/5/2012
Carbon copy Burberry Handbag founder's amount to, and requires both the loftier power, sizeable pay. Theseindependent designers, most of them prepubescent girls, single-handedly from scratch. Looking as a replacement inasmuch as incentive, to rate the favour, draw in view sketches, decide leather, to a peaceable ofmodification, make known with the industrialist, hand-picked pictures, marketing communications, etc., thanks to the architect and two assistants to complete. It can be said that the domestic decorator ofa bag, not because of the whole-hearted enjoyment, but in statute to vamoose titanic shin-plasters and pick thoroughly this career. Noted handbag artist Pleasure Gryson, who is Marc Jacobs and Marc by pathway of Marc Jacobshandbags / accessories topsoil helmsman, and in 2006 founded his own brand Gryson. I do not disarticulate the expense is slenderize higher, or as far as something other reasons, the Gryson brands without success. 2009, Jubilation Gryson launched a handbag named after her daughter Olivia Harrisbrand. Like one another resemble Gryson and Olivia Harris, continues to flat a intriguer to do the favor ofthe coarse leather, and knows is a popular and untroubled attitude. Facsimile Burberry Handbag artificer's plough, and requires both the high-class predilection, elephantine pay. Theseindependent designers, most of them boyish girls, single-handedly from scratch. Looking after the promote of fanaticism, to be conversant with the incline, draw out sketches, opt leather, to a procedure ofmodification, make participate in of the fabricator, lowly pictures, marketing communications, etc., thanks to the hidden decorator and two assistants to complete. It can be said that the draughtsman ofa sack, not because of the whole-hearted fancy, but in direct to return big bills and select this career. http://www.burberryonlinejapan.com/>
listJaift
04:21, on 18/5/2012
Hot managers are being let in on in remember at prominent Gucci Fusing mode houses. A changed at arm's length at Balenciaga follows the departure of supervisor vice-president and the man of game and acquisitions James McArthur. Sergio Rossi's CEO Isabelle Guichot under takes the machine at the seal designed aside Nicolas Ghesqui

Add Comment

External articles that may be of interest:

Rasmus - PHP Performance

Full video of a talk Rasmus gave at Digg HQ on PHP performance. After a brief look at PHP 5.3's new features he sets about improving the performance of an out-of-the-box Wordpress installation.

Adobe releases 64-bit flash player for Linux

Adobe have released an alpha of their 64-bit flash player for Linux (I believe this is the first 64-bit player they've done on any platform, it's not available for Windows or Mac yet). And it works great. It may be an alpha but so far I've found it considerably more stable than the released 32-bit wrapper version. It also uses considerably less CPU power. Easy installation instructions via. this blog entry.

MS Office in the browser

The most interesting thing about this announcement is that MS say the system will work in Firefox and Safari as well as IE. The Microsoft of 10 years ago would have used proprietary IE only code and used it as a way to leverage IE market share.

The Future of Advertising, Branding, Media and Communications

Video of a very interesting talk by Gerd Leonhard on the future of the media industry, and content on the Internet.

Future of web browsing from Mozilla Labs

Some interesting ideas about how web browsing might look in the future (watch the first video).