Issues 14, 15 refactoring _at_HttpMethod

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 12 Oct 2007 12:30:45 -0400

Issues 14[1] and 15[2] are about changes to @HttpMethod. Essentially
instead of:

public Foo getFoo()

you could write

public Foo getFoo()

I like the conciseness of this but @UriTemplate has other attributes
in addition to the template string and I don't think it makes sense
to duplicate these on other annotations. Instead I'd propose to make
@HttpMethod a meta-annotation and define a set of annotations for the
common HTTP methods using this meta-annotation, e.g.:

public @interface GET {}

Anyone could define their own annotations for additional HTTP methods
if they so desired since implementations would only look at the value
of meta-annotation to find the HTTP method for a given annotation.

With this you could write:

@GET @UriTemplate("foo")
public Foo getFoo()

It would be nice of we could also rename UriTemplate to something
shorter but URI is already taken...

Thoughts ?


Marc Hadley <marc.hadley at>
CTO Office, Sun Microsystems.