Bill Burke wrote:
> It smells like a hack because of JAX-RS's current reliance
> on constructing providers and resources from raw classes rather than
> letting registering raw classes for Providers and Resources rather than
> allowing the application
>
Ugh, let me rewrite this so you can actually understand what I'm trying
to say :)
It smells like a hack because of JAX-RS's reliance on constructing
providers and resources from raw classes. Since EE has no real POJO
dependency injection you're forced to do hacky things like
ContextResolver to initialize and configure your providers/resources.
You don't need things like ContextResolver if application developers
have control over provider/resource instantiation.
For example, the RESTEasy Spring implementation allows you to define
JAX-RS annotation POJOs in spring XML and then registers the bean
instance with the RESTEASy JAX-RS runtime. For the JAXB ContextResolver
usecase described in the specification, this could easily be implemented
by letting the app-developer define @Providers using a DI container like
spring or Guice (I believe Web Beans could help out with this too).
Bill
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com