dev@jsr311.java.net

Re: JSR311: _at_Target of FIELD for _at_*Param annotations

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 10 Mar 2008 12:20:07 -0400

Bill Burke wrote:
>
>
> Marc Hadley wrote:
>> On Mar 10, 2008, at 11:39 AM, Bill Burke wrote:
>>>>>
>>>> That's hardly fair, nothing is stopping you innovating.
>>>
>>> Sure it is. I want to use @*PARAM on fields, for resource classes,
>>> MessageBodyReader/Writers, and mapping POJO parameters. Now, because
>>> you're refusing to change the @Target, I either have to scrap it, or
>>> have a parallel *exact* annotation hierarchy.
>>>
>> Your innovation is a more powerful set of annotations, I'm not
>> stopping you defining such a set.
>>
>
> Ugh....I want to *re-use* JAX-RS annotations to provide a more powerful
> set of features. Who knows what else people will come up with with
> field @*Param injection? The point it, not to restrict them. I've
> already give a bunch of use cases for this, so I just don't know how
> else to convince you...
>


It also fits in very well with WEb Beans integration. Say you have a
bean called by JSF EL. The component is interested in some additional
header information (like a cookie), so it annotates a field with the
addtional contextual information it is interested in. Sure, only works
in instance-per-request. but very nice in this situation.

Why not just change the spec to support field injection for
instance-per-request components? (i.e. MessageBody's and out-of-the-box
resource clases)? That solves the portability problem right there.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com