On 31/10/2013 12:36 PM, Cameron Jones wrote:
> This isn't the only problem though, it's just another case of JAX-RS
> using different DI rules.
>
> Another example is @*Param, these are automatically injected in JAX-RS
> whereas in DI they require @Inject.
My view is that JAX-RS shouldn't mandate *any* injection rules. I
understand that you're expecting JAX-RS to ensure DI portability so I
can easily switch between one DI provider to another without having to
change my JAX-RS code but for me this is a non-goal. I *should* have to
change my code if I move from Guice to Spring to HK2. First of all,
people change DI providers as often as they change databases (almost
never). Secondly, JAX-RS is not in the DI portability business, nor
should it be. Leave that up to JSR 330 extensions that will one day make
DI providers portable.
Gili