[weld-dev] Question about @Decorates

David Allen drallendc at gmail.com
Sat Oct 24 03:39:41 EDT 2009


On Fri, 2009-10-23 at 16:57 -0400, Gavin King wrote:
> Does Weld currently require the use of @Inject on delegate injection points?

No, it does not.

> 
> I've just noticed that with the change to the 330 annotations, it
> perhaps makes more sense to change the name of this annotation and
> require that @Inject be used, like this:
> 
> 
>    @Decorator
>    class TimestampLogger implements Logger {
>       private Logger logger;
> 
>       @Inject
>       public TimestampLogger(@Delegate @Debug Logger logger) {
>          this.logger=logger;
>        }
>        ...
>    }
> 
>    @Decorator
>    class TimestampLogger implements Logger {
>       @Inject @Delegate @Any Logger logger;
>       ...
>    }
> 
> We could perhaps even say that @Delegate is a qualifier.

This appears to be more consistent and thus easier to understand IMO.

> 



More information about the weld-dev mailing list