dev@jsr311.java.net

RE: Naming of annotations <was> Re: Redirection and creation <was>

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Thu, 12 Apr 2007 17:09:17 +0200

Dhanji,

> the JSR-220 spec refers to this JWS api to expose web
> services in accordance with JAX-RPC (JSR-220 also requires
> exposing via soap from this annotation).
> Of course you can use these annotations outside of session beans.

Should I understand that JSR-220 prevents the usage of other annotations, or
even mandates the usage of JWS API. Could I say that my EJB session isn't
supporting the JWS API but instead uses JSR-311 API?

> In the rare cases where both RESTful and
> SOAP Web Services should be exposed from the same
> POJOs, then package names
> should solve the issue. Otherwise, there is little
> interest in having
> namespaces.
>
> This is a compelling argument. I would agree were it not for
> the fact that in practice it does introduce unnecessary
> confusion and ambivalence (at the *very* least IDE
> auto-completion can get messy). I also feel that @WebResource
> is too general a name (@WebMethod might be a bit better, but
> why not avoid it altogether and use a clear unique set?).

This is a matter of taste mostly. Here are my preferences:
        1) @Resource -> conflict with common JEE annotation
        2) @WebResource -> potential conflict with JWS API
        3) @RwsResource (clearer than @RWSResource)
        4) @RsResource (clearer than @RSResource)
        5) @HttpResource -> too HTTP-centric

Best regards,
Jerome