开发者

PHP annotations : Addendum or Doctrine Annotation?

  • Addendum
  • Doctrine 2 Annotations

Can you give me any reason one is better than the other ?

Here my list for now :

  • Addendum is a project dedicated for that
  • Addendum seems to have开发者_Go百科 more functionnalities
  • Addendum API seems easier to use
  • Doctrine has more support and more people involved
  • Doctrine seems to be a project more alive
  • Doctrine is fully compatible PHP 5.3, whereas Addendum seems to be trying to become compatible (see home page)
  • Doctrine Annotations can be cached easily

The decision is not easy...


I suppose I'd rather use the Doctrine's component :

  • I've never heard of Addendum -- while I've heard a lot about Doctrine (and have used it several times)
    • Which means more community and support for Doctrine
  • Doctrine is used by some big Frameworks (symfony ; and can easily be integrated with Zend Framework)
    • Which means chances are higher that you'll already use Doctrine ; and find developers who are familiar with its syntax
  • Maybe less important for you, But some guy from Doctrine's team has done some work on getting Annotations integrated into PHP
    • There is a RFC : Request for Comments: Class Metadata
    • For now, it doesn't seem this is going to be integrated into PHP, but it means there is works done by the Doctrine's team, that shows their solution has some thinking


For what it's worth...

I've been using Addendum for a year now, and I've found it ridiculously easy to use. Its extension to the PHP Reflection API is seamless, and it supports far more use cases than Doctrine Annotations component.

It lacks namespaces support, but I could patch AnnotationMatcher class so it accepted namespaced classes (without getting false matches from docblock tags) and it has worked like a charm.

Doctrine's annotations takes into account PHP 5.3 use statements. That's the only thing that Addendum does not do and IMO it wouldn't be so trivial to implement.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜