Re: Annotation RFC + Patch

From: Date: Thu, 26 Aug 2010 11:12:13 +0000
Subject: Re: Annotation RFC + Patch
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-49538@lists.php.net to get a copy of this message
On Thu, 26 Aug 2010 11:17:33 +0200, Benjamin Eberlei <kontakt@beberlei.de> wrote: > Hey, > > 3. > Ok that point may be relevant, but there is also a semantically nice and > simple solution: > > array('JoinTable' => array( > 'name' => 'users_phonenumbers', > 'joinColumns' => array( > 0 => array('JoinColumn' => array('name' => > 'user_id', > 'referencedColumnName => 'id')), > 1 => array('JoinColumn' => array('name' => > 'user_id', > 'referencedColumnName => 'id')), > ) > )); > [JoinTable( name="users_phonenumbers", joinColumns={ {JoinColumn={name="user_id", referencedColumnName="id"}}, {JoinColumn={name="user_id", referencedColumnName="id"}} } )] I think this gives you the same array structure as in your example but it uses no nested annotations. > > 5. You already mentioned further extensions with aliasing class names to > "shorten" > the annotations specification. However i see several problems with that: > > a.) It adds more code > b.) Classes/Methods/Functions/Properties that have annotations of multiple > annotation libraries > will cause pain with loading or autoloading of the necessary annotation > classes. > c.) What happens if an annotation has no corresponding class? > You write that the developers should implement her complex class based solution in userland. How would you handle aliasing for classes there? Anywhere I must define the alias or the namespace of the annotation class, otherwise I must register all annotations(annotation name => fully qualified class name) used in my application before using them. Using annotations from different frameworks with the same name makes this a pain. Greetings, Christian

« previous php.internals (#49538) next »