On Jul 8, 2008, at 11:21 PM, Gérald Quintana wrote:

> What about using annotations/ideas from JSR 311 aka JAX-RS annotations
> (@HttpMethod("MYHTTPVERB", @GET, @PUT...) ? Being very close to Sun's
> "standard" could bring better acceptance.

Yea, I looked at that today. I hadn't really though about that JSR,  
though when you brought it up it triggered an "Oh yeah" moment.

On the one hand, I think they could (almost) be adopted wholesale,  
since they pretty much do the same thing (it IS the same problem,  
after all).

On the other hand, though, especially after reading it, I don't see a  
real need to make the Stripes REST layer to be 311 compliant.

So, if we use the same annotations, they may well confuse users who  
expect it to work like 311. The words will be the same, but the  
implementation and very possible the actual semantics will be different.

Frankly, I'm game either way, but the potential for confusion bears a  
bit on my soul.

What do you think?

Also, what do you think about Convention over Configuration on top of  
pure annotations?

If we do:
public Resolution <eventname><HTTP Methodname>

You think that's a good thing or a bad thing?

@Rest
@UrlBinding("/action/blog/{$event}")
public class RestActionBean implements ActionBean {
     // default event processes
     public Resolution post() { ... }
     public Resolution get() { ... }
     public Resolution delete() { ... }

     // for the "month" event (event and REST don't really mix, but  
that's the way the baby bounces)
     public Resolution monthGet() { ... }
     public Resolution monthPost() { ... }
     public Resolution monthDelete() { ... }
}

Assuming we can annotate any Resolution method as we like, but by  
default using convention.

Note I moved @Rest all the way to the class level so we wouldn't have  
to annotated each method.

Anyway, just some more gas for the fire.

Regards,

Will Hartung


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to