Hi David

On Thu, Oct 14, 2010 at 5:30 PM, KARR, DAVID (ATTSI) <[email protected]> wrote:

> I'm considering the balance of annotations vs. XML config.  There's not
> much in a CXF controller that requires XML configuration (not for what
> I've used CXF for so far).


If I were to choose, I'd consider how likely it is that my PATH annotation
values or various other JAXRS properties expressed via annotations will
change often enough ? Would it be cheap enough to update the resource
classes should such changes occur ? Can I even update the code which will
serve as a RESTful server ? How many dynamic root resources will I have ? Is
it DOSGI ? If things are relatively static then may be I'd not go for a
non-annotations feature...



>  About the only reason I'm still defining the
> bean in the XML config is that I have to put the bean into the
> "jaxrs:serviceBeans" list, and I don't like to specify bean names in
> annotations.  It might be reasonable if I could have an annotation like
> the following on my Controller:
>
> @JAXRSRegister("MyJAXRSServerName")
>
> On the other hand, perhaps I'm mistaken about what I need to configure
> here.  In the documentation, I found the following statement:
>
>    "Note that when registering a model from Spring you do not need to
> declare a jaxrs server serviceBeans section - the runtime will
> instantiate the beans itself."
>

The external model can refer to a service bean class. One only needs to add
a serviceBeans section if the external
model refers to an interface (which one or more concrete service beans will
implement).

If you do not want to use an xml configuration (Spring beans) at all then
may be you may want to try CXFNonSpringJAXRSServlet ?

cheers, Sergey

Reply via email to