On Thu, 26 Aug 2010 11:17:33 +0200, Benjamin Eberlei <kont...@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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to