users@javaee-spec.java.net

[javaee-spec users] Re: [jsr342-experts] Re: CDI positioning

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Fri, 31 Aug 2012 13:47:55 -0700

santiago.pericasgeertsen_at_oracle.com wrote on 08/31/12 13:26:
> Hi Pete,
>
> Just to be clear, is this your suggestion?
>
> (i) Deprecate @Context and related classes (like ContextResolver) in
> JAX-RS. These have been there since JAX-RS 1.X, likely before CDI was
> finalized. Of course, deprecation means that JAX-RS 2.0 implementations
> will still need to support them for backward compatibility.

Whether they're formally deprecated is a separate question. We've
seen that lots of developers don't like us to deprecate things that
work perfectly well. We may just want to steer people towards a
different approach using CDI while leaving the existing APIs unchanged.

> (ii) Have JAX-RS 2.0 define a small subset of CDI for non-EE
> environments. And carefully list the caveats of porting a JAX-RS EE
> application into a non-EE environment.

I don't think we're planning to subset CDI. The decision to be made
is whether the dependency on CDI is hard or soft. If soft, JAX-RS would
work without CDI, but some things might have to be done in a less
convenient way.

> I'm not sure what you mean by the statement: "and JAX-RS is fully
> functional without injection,". JAX-RS actually depends very heavily on
> injection. I may be missing some context here.

Are there objects that can only be acquired using injection, and can't
be acquired any other way?