users@jersey.java.net

[Jersey] Re: Why is JSR 330 not enough?

From: Cameron Jones <cmhjones_at_gmail.com>
Date: Tue, 29 Oct 2013 15:35:14 +0000

On Mon, Oct 28, 2013 at 11:37 PM, Danilo Reinert <daniloreinert_at_gmail.com>wrote:

> It's just unacceptable that Jersey 2 forces end-users to use an arbitrary
> DI framework.
>
> This seems more a "corporate political decision" than a "well
> thought architectural decision".
>
> --
> D. Reinert
>
>
Jersey 1.0 was always forcing you to use a DI framework, its just that the
framework was built into the library.

There is definitely a greater dependency/integration with Glassfish in
Jersey 2.

If you look at the deployment environment, if you're deploying into EE then
if you use Jersey you should probably just accept the full Glassfish stack.
If you use SE then you might as well use HK2 for DI, as you're going to be
using it anyway.

The scope for 'mix-n-match' JSR-330 implementations was never a goal.

CDI provides the kind of 'swappable' DI interface but is a much bigger
dependency to introduce than HK2.

I can't really comment on the decision making process (other than Jersey
part of the GF family), but the Jersey project has provide DI features
which are inherent in JAX-RS so it must be satisfied somehow.

There's quite a bit in Jersey 2 + HK2 which is much cleaner now, but i'm
not sure anyone has really tackled cross-DI integration and the concept of
having multiple DI containers is really pushing some of the DI impacts.

Thanks,
Cameron Jones