开发者

Zend Framework :: ORM - doctrine / propel over Zend_Db_Table

do anyone suggest using an external ORM like Doctrine/Propel over the defual开发者_开发百科t Zend_Db_Table in Zend Framework ?

I think your answers with reasons would be valuable across the ZF community.

-DevD


It depends on how you have designed your application.

With the exception of ActiveRecord, ZF provides implementations for three of the four Data Source Architectural patterns in PoEAA. If your model objects map very closely to your database structure, then the ZF components might be sufficient for your app.

If your objects are mapped to/aggregated from multiple tables, a custom DataMapper on top of the ZF DB classes or a full fledged ORM, like Doctine or Propel might be better suited. Only you can decide this.


A full fledged ORM might also provide some extra functionality that is useful for you. Some might like DQL as used in Doctrine, others maybe would like to avoid writing queries by hand to retrieve objects, and might prefer fluent interfaces like the ModelCriteria Query API in the upcoming Propel 1.5.

So basically, it all depends on your own needs, there's no single "best solution" that fits all projects.


I would recommend:

  1. Doctrine 2.0 - cross platform, ease of use, good performance, good documentation, support for namespaces, powerfull, maybe it will be a part of ZF 2.0
  2. Doctrine 1.2 - cross, platform, ease of use, easy to implement, useful extensions (e.g NestedSet, Taggable, Commentable), good documentation, works with ZF autoloader, CLI tool, YAML, data fixtures
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜