Hi Richard, Comments inline
On Fri, Sep 17, 2010 at 11:16 AM, Richard Quadling <rquadl...@gmail.com> wrote: > On 17 September 2010 14:17, Rafael Dohms <lis...@rafaeldohms.com.br> wrote: >> On Fri, Sep 17, 2010 at 6:28 AM, Christian Kaps >> <christian.k...@mohiva.com> wrote: >>> On Fri, 17 Sep 2010 10:02:10 +0100, Richard Quadling >>> <rquadl...@gmail.com> wrote: >>>> One thing that did come to mind is if we ignore all the issues and >>>> complexities of actually implementing annotations, are annotations >>>> useful to a significant number of userland developers. On the surface, >>>> (and this is probably where I'm going wrong), it would seem to only >>>> really be of use to framework developers, and whilst there are at >>>> least 2.5 frameworks per developer, the vast majority of userland >>>> developers are not framework developers. >>> >>> This isn't right. At a first glance, yes it looks that only framework >>> developers can have a benefit from annotations in the core. But the >>> annotations extending the API of a framework so that all developers >>> which using this frameworks have a great benefit of them. >>> >>> Lets take as dependency injection as example. If the framework >>> implements this concept than the user of the framework make the usage of >>> this. Or the bean validation framework. This is only for the framework >>> users. >>> >> >> I agree with Christian here, something that is "for framework >> developers" benefits all of the userland users that use that >> framework. >> So we are not looking at the minority of framework developers but at >> the majority of framework users. >> >> So i think the point of "is there use for annotations" is mute, yes >> there is and we don;t see more examples cause we never had it. >> How often did anyone suggest creating a state machine in the ZF >> Controller before we had goto available? once it became available we >> started finding uses for it. >> >> So i'm pretty sure one Annotations exist, more and more people will >> get familiar with it and find new ways to use it in their mindset. > > Thanks for that. > > So, where can I read something about annotations aimed at what must be > painfully obvious someone without all the skills. Unfortunately, my primary source of knowledge contains dummy information, which is Wikipedia. So, for an average explanation of usage, you can check the Annotations RFC[1] or what is described in Java Annotations[2] (although I'm in favor entirely of it). > > How would I use annotations? What problems that I don't know I have do > they solve for me? In PHP exclusively, I can point you the JSR-303 (Bean Validation) that is implemented in Symfony 2. Here is the source: http://github.com/symfony/symfony/tree/master/src/Symfony/Component/Validator/ Usage example: http://docs.symfony-reloaded.org/guides/validator.html Another good example is to map your persistence data into your Entities. Doctrine 2 implements this and I think that way you can compare easily with the PHP code alternative. I'd like to ask you to compate the same Entity mapped through Annotations emulator and using raw PHP code: CmsUser using Annotations: http://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/Models/CMS/CmsUser.php CmsUser using PHP code: http://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php I can't be more explicit how beneficial it is with Annotations support. > > Richard. > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Guilherme Blanco Mobile: +55 (16) 9215-8480 MSN: guilhermebla...@hotmail.com São Paulo - SP/Brazil -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php