users@jersey.java.net

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

From: Cameron Jones <cmhjones_at_gmail.com>
Date: Mon, 28 Oct 2013 17:36:25 +0000

On Mon, Oct 28, 2013 at 4:07 AM, Gili T. <cowwoc_at_bbs.darktech.org> wrote:

> Out of curiosity, why does jersey depend directly on HK2? Couldn't it
> depend on JSR330 instead, allowing us to plug in hk2, spring or guice as we
> see fit? What is JSR 330 missing?
>
> Thanks,
> Gili
>

JSR-330 is a bit light-weight and doesn't specify how applications are
configured. This would mean that Jersey would have to integrate with every
DI container to configure itself.

Also, JAX-RS has some of it's own non-standard DI rules which wouldn't be
definable without customizations to injection processing. This would also
need to be defined per-container.

At what point does JAX-RS stop and the generic definition of DI containers
begin?

JAX-RS DI was discussed by the JSR expert group, and they found the options
available to either be lacking in features (JSR-330) or overkill with
redundant features (JSR-299), see slide 59:

http://www.slideshare.net/arungupta1/jax-rs20

Thanks,
Cameron Jones