[UPHPU] Should I Be Using an ORM?

Alvaro Carrasco simplepic at gmail.com
Tue Jul 21 11:24:54 MDT 2009


Kirk Ouimet wrote:
> Hi List,
>
>  
>
> Had a couple questions to post this morning. This one is very open-ended.
> I've been looking at PHP ORM's like:
>
>  
>
> http://www.doctrine-project.org/
>
>  
>
> And am curious to know if it's worth my time to learn and use a system like
> this. Thoughts?
>
>  
>
> Kirk Ouimet
>
>  <mailto:kirk at kirkouimet.com> kirk at kirkouimet.com
>
> Cell: (801) 310-1421
>
>   

I think the main reason for an ORM is to allow you to more easily create 
a Domain Model [PoEA]. If all you're doing is managing rows in the 
database or creating reports, then you probably don't need one. If 
you're looking to create a system that captures the complexities of a 
domain in a way that is easy to understand, maintain, and extend then 
you might want to model the domain that you're working on using objects 
and take advantage of the the many patterns available when using 
object-oriented programming. A nice ORM will help you head in that 
direction.

I personally use an ORM for almost all of my projects. I personally 
think it's generally more enjoyable to work with a nice ORM  than 
without. I have used Propel in the past and have looked at Doctrine.

I think the coolest one by far is Outlet http://www.outlet-orm.org (a 
little biased, I wrote it :P ). It's much smaller than either Propel or 
Doctrine but it provides a LOT of nice features while staying very 
transparent.

Keep in mind that you'll likely still be making sql calls here and there 
and that's fine. An ORM is ill-suited for doing reports, batch updates, 
aggregations, etc.

Alvaro




More information about the UPHPU mailing list