On 4/17/12 11:37 AM, Santiago Pericas-Geertsen wrote:
>
> On Apr 17, 2012, at 7:45 AM, Marek Potociar wrote:
>
>> There are 2 solutions that I've been thinking about:
>>
>> 1. introduce an injectable request-scoped ResourceContext with
>> methods like inject(Class<?> subresourceClass), inject(Object
>> subresource)
>> 2. update the spec to mandate field injection on the sub-resource
>> instances returned by sub-resource locator.
>>
>>
>> So far I am leaning towards #1 as it seems more flexible.
>>
>> Any thoughts on the above?
>
> Why not both? As you say, (1) is more flexible but (2) is quite convenient.
>
I don't see why you need #1 if you have #2. Things would be doubly
injected. Also, is there any issues with singletons vs. per-request
sub-resource instances? I can't think of any at the moment, so long as
injected things are proxied appropriately.
Bill
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com