[weld-dev] Question about @Decorates
Pete Muir
pmuir at redhat.com
Tue Oct 27 11:27:58 EDT 2009
On 24 Oct 2009, at 08:39, David Allen wrote:
> 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.
Yup, I agree with this too.
I'll file a JIRA issue.
More information about the weld-dev
mailing list