dev@jsr311.java.net

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

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 12 Apr 2007 14:03:29 +0200

Dhanji R. Prasanna wrote:
> The idea of using a URI template is a nice touch. Also I also find
> rather appealing the renaming of UriTemplate and HttpMethod to
> WebResource (i consider the issue with the WebResource interface as
> separate thing) and WebMethod respectively.
>
>
> I dont think this is wise as @WebMethod is a jws annotation used to
> expose EJB methods via WSDL-style webservices.

Foiled again! Darn, this naming thing is tricky!


> Neat as it reads, I believe it is too general--not only risking
> conflicts with other apis but purporting to be too much (a la RTF/ASF's
> objection to the use of "rest").
> A more specific naming scheme would serve better:
>
> @RSMethod
> @RSName("/target/{id}")
>

Then I prefer HttpMethod :-)


>
> > @Resource
> > Context ctx;
>
> 'ctx' would need to be a field on the class or a parameter of the method
> for standard injection to work. (we could do some byte code injection
> :-) but that is tricky!)
>
>
> I would be wary of supporting @Resource without having a full
> understanding of various deployment targets.
> In EE containers for instance you will need to search jndi for a
> resource named "ctx" (which may have nothing to do with the current
> Context) and potentially support other things like auth semantics (or
> risk confusing the end-user if you dont).
>
> If we're using it simply to mark an injection point for the Context
> artifact, I'd suggest a custom annotation. Leveraging @Resource can open
> the door to a whole lot of stuff to consider (or to ignore as the case
> may be), which can make life tough for an end user.
> The other common annotations (@PostConstruct, @PreDestroy) also drag us
> into the world of application containers. Their canonical uses (EJBs,
> JSF beans) have clearly defined ideas of scope and lifecycle. Do we have
> (and do we want to) this as a separate discussion?
>

A new thread would be very useful. Would you be willing to provide a
summary in a new email on annotation naming?

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109