<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: JSR 311, JAX-RS: Comment and suggestions</title>
	<atom:link href="http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/feed/" rel="self" type="application/rss+xml" />
	<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/</link>
	<description>tech talk radio</description>
	<pubDate>Sat, 19 Jul 2008 13:42:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: Ryan de Laplante</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-972</link>
		<dc:creator>Ryan de Laplante</dc:creator>
		<pubDate>Sat, 01 Dec 2007 17:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-972</guid>
		<description>We should be able to use JAX-RS with EJB 3.1 components and WebBean components too</description>
		<content:encoded><![CDATA[<p>We should be able to use JAX-RS with EJB 3.1 components and WebBean components too</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-424</link>
		<dc:creator>billburke</dc:creator>
		<pubDate>Fri, 26 Oct 2007 09:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-424</guid>
		<description>Start Raving...

1) The specification has "Entity Providers" which allow you to encapsulate the mapping between objects and the wire format.  Please travel the links I provided in the blog for more information.  As far as your "separation" concern, I don't think its a big deal.  If you want the decoupling just have your Restful webservice delegate to a POJO, EJB, or Spring bean.  Also, the separation is another reason I want to be able to restfully annotation interfaces instead of just the bean class.  IN EJB I always saw the interface as the view you wanted to publish over a particular protocol.

2-4)  Thanks for the suggestions.  I'm a total REST noob, have never written a RESTful application, so its good to hear best practices and such.</description>
		<content:encoded><![CDATA[<p>Start Raving&#8230;</p>
<p>1) The specification has &#8220;Entity Providers&#8221; which allow you to encapsulate the mapping between objects and the wire format.  Please travel the links I provided in the blog for more information.  As far as your &#8220;separation&#8221; concern, I don&#8217;t think its a big deal.  If you want the decoupling just have your Restful webservice delegate to a POJO, EJB, or Spring bean.  Also, the separation is another reason I want to be able to restfully annotation interfaces instead of just the bean class.  IN EJB I always saw the interface as the view you wanted to publish over a particular protocol.</p>
<p>2-4)  Thanks for the suggestions.  I&#8217;m a total REST noob, have never written a RESTful application, so its good to hear best practices and such.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stark Raving Coder</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-422</link>
		<dc:creator>Stark Raving Coder</dc:creator>
		<pubDate>Thu, 25 Oct 2007 17:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-422</guid>
		<description>Bill, 

I really like your analysis and suggestions but there are few code smells that remain for me. Perhaps you simply haven't covered all these things. 

1) &lt;strong&gt;Formatting&lt;/strong&gt; - It seems to me that the annotations assign specific output and input mime types. This breaks the model of separating presentation from behaviour that we get from MVC, doesn't it? Why should my code care if the client wants XML or JSON or HTML or PDF for that matter? Same with incoming data. It seems to me that what is needed is some standard facility to take incoming data (either as JSON, XML or HTTP parameters (get &#38; post) and convert it into some standard structure that can be consumed by my methods. In addition, I should be able to assign some set of views to the output of my method to the format required by the client. Rails does an excellent job of this.

2) &lt;strong&gt;Verbs&lt;/strong&gt; - As Ryan pointed out, its necessary to be able to handle arbitrary verbs to do new things. In addition, browsers are not RESTful clients since users can only create POST and GET requests, some standard facility for "faking" PUT and DELETE with a POST will be useful. Yes, I know that you can do PUT and DELETE using AJAX; that only means that XMLHTTPRequest is a restful client. Perhaps I should say HTML User Agents.

3) &lt;strong&gt;Adjectives&lt;/strong&gt; - Often its beneficial to supply an adjective to the request. For example, normally I'd POST to /blogs/123/posts/12210/comments to create a new comment. However if I want to get a preview of my comment then I've seen it suggested that I want to post to /blogs/123/posts/12210/comments;preview. That is create a real, but temporary, comment and return it. Another example is if I'm making requests from a browser for HTML. If I ask for /blogs/123/posts/12210 then I get the post, but if I want to edit it, I'm stuck, unless I can ask for /blogs/123/posts/12210;edit.

4) &lt;strong&gt;Pluralization&lt;/strong&gt; - Personally I think that you should GET from /blogs for a list of blogs and /blog/123 for a specific blog.</description>
		<content:encoded><![CDATA[<p>Bill, </p>
<p>I really like your analysis and suggestions but there are few code smells that remain for me. Perhaps you simply haven&#8217;t covered all these things. </p>
<p>1) <strong>Formatting</strong> - It seems to me that the annotations assign specific output and input mime types. This breaks the model of separating presentation from behaviour that we get from MVC, doesn&#8217;t it? Why should my code care if the client wants XML or JSON or HTML or PDF for that matter? Same with incoming data. It seems to me that what is needed is some standard facility to take incoming data (either as JSON, XML or HTTP parameters (get &amp; post) and convert it into some standard structure that can be consumed by my methods. In addition, I should be able to assign some set of views to the output of my method to the format required by the client. Rails does an excellent job of this.</p>
<p>2) <strong>Verbs</strong> - As Ryan pointed out, its necessary to be able to handle arbitrary verbs to do new things. In addition, browsers are not RESTful clients since users can only create POST and GET requests, some standard facility for &#8220;faking&#8221; PUT and DELETE with a POST will be useful. Yes, I know that you can do PUT and DELETE using AJAX; that only means that XMLHTTPRequest is a restful client. Perhaps I should say HTML User Agents.</p>
<p>3) <strong>Adjectives</strong> - Often its beneficial to supply an adjective to the request. For example, normally I&#8217;d POST to /blogs/123/posts/12210/comments to create a new comment. However if I want to get a preview of my comment then I&#8217;ve seen it suggested that I want to post to /blogs/123/posts/12210/comments;preview. That is create a real, but temporary, comment and return it. Another example is if I&#8217;m making requests from a browser for HTML. If I ask for /blogs/123/posts/12210 then I get the post, but if I want to edit it, I&#8217;m stuck, unless I can ask for /blogs/123/posts/12210;edit.</p>
<p>4) <strong>Pluralization</strong> - Personally I think that you should GET from /blogs for a list of blogs and /blog/123 for a specific blog.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The rise of meta-annotations &#171; Angry Bill</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-401</link>
		<dc:creator>The rise of meta-annotations &#171; Angry Bill</dc:creator>
		<pubDate>Mon, 22 Oct 2007 11:58:51 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-401</guid>
		<description>[...] JSR 311, JAX-RS: Comment and&#160;suggestions [...]</description>
		<content:encoded><![CDATA[<p>[...] JSR 311, JAX-RS: Comment and&nbsp;suggestions [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Client driven business activity &#171; Angry Bill</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-362</link>
		<dc:creator>Client driven business activity &#171; Angry Bill</dc:creator>
		<pubDate>Mon, 15 Oct 2007 19:29:56 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-362</guid>
		<description>[...] JSR 311, JAX-RS: Comment and&#160;suggestions [...]</description>
		<content:encoded><![CDATA[<p>[...] JSR 311, JAX-RS: Comment and&nbsp;suggestions [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo Pelegri-Llopart</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-354</link>
		<dc:creator>Eduardo Pelegri-Llopart</dc:creator>
		<pubDate>Sat, 13 Oct 2007 17:55:33 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-354</guid>
		<description>Hi Bill.  I presume you have already provided your feedback to the JSR-311 EG through Heiko, but, if not, I'd encourage you to also use that channel, in addition to this blog; I know that Marc and Paul are trying very hard to run a public Expert Group.

Re: the relationship between the implementation (Jersey, at http://jersey.dev.java.net) and the Specification, the implementation follows the specification, but it also helps try things out and ensure the specification is implementable and useful. But definitively, the specification drives the implementation, not the other way.

 - eduard/o</description>
		<content:encoded><![CDATA[<p>Hi Bill.  I presume you have already provided your feedback to the JSR-311 EG through Heiko, but, if not, I&#8217;d encourage you to also use that channel, in addition to this blog; I know that Marc and Paul are trying very hard to run a public Expert Group.</p>
<p>Re: the relationship between the implementation (Jersey, at <a href="http://jersey.dev.java.net" rel="nofollow">http://jersey.dev.java.net</a>) and the Specification, the implementation follows the specification, but it also helps try things out and ensure the specification is implementable and useful. But definitively, the specification drives the implementation, not the other way.</p>
<p> - eduard/o</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DamnHandy : &#187; The potential of a JAX-RS client API</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-348</link>
		<dc:creator>DamnHandy : &#187; The potential of a JAX-RS client API</dc:creator>
		<pubDate>Thu, 11 Oct 2007 13:10:17 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-348</guid>
		<description>[...] Burke has just posted a bunch of really great feedback on the latest draft of the JAX-RS spec. If you haven&#8217;t had a chance to look at the spec, head [...]</description>
		<content:encoded><![CDATA[<p>[...] Burke has just posted a bunch of really great feedback on the latest draft of the JAX-RS spec. If you haven&#8217;t had a chance to look at the spec, head [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-345</link>
		<dc:creator>billburke</dc:creator>
		<pubDate>Thu, 11 Oct 2007 01:15:30 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-345</guid>
		<description>Ryan, so define an annotation for each webdav and http method:

javax.ws.rest.httpmethod.@Get, etc....
javax.ws.rest.webdevmethod.@Whatever

Then what you have is typesafe and the compiler can catch typos rather than waiting for deployment or runtime to find the problem.  Its also great for IDE's autocompletion as well.  Have @HttpMethod as a fallback just in case new methods are added in the future maybe, i don't know.  

No, I don't like the @UriTemplate("MKCOL", "/shopping/orders/{ID}") syntax either.</description>
		<content:encoded><![CDATA[<p>Ryan, so define an annotation for each webdav and http method:</p>
<p>javax.ws.rest.httpmethod.@Get, etc&#8230;.<br />
javax.ws.rest.webdevmethod.@Whatever</p>
<p>Then what you have is typesafe and the compiler can catch typos rather than waiting for deployment or runtime to find the problem.  Its also great for IDE&#8217;s autocompletion as well.  Have @HttpMethod as a fallback just in case new methods are added in the future maybe, i don&#8217;t know.  </p>
<p>No, I don&#8217;t like the @UriTemplate(&#8221;MKCOL&#8221;, &#8220;/shopping/orders/{ID}&#8221 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> syntax either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan J. McDonough</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-344</link>
		<dc:creator>Ryan J. McDonough</dc:creator>
		<pubDate>Thu, 11 Oct 2007 01:02:22 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-344</guid>
		<description>This feedback is really great. I love the @Location idea! It's a very elegant way of declaring a redirect response when creating a new resource. Awesome! 

In regards to the @Get, @Post, @Delete, @Put annotations: the idea is great but it could also be limiting as well. The idea behind the @HttpMethod is that allows an implementation to use lesser used HTTP methods as well as those from the WebDAV spec. Therefore, one could do:
&lt;code&gt;
@HttpMethod("MKCOL")
@UriTemplate("/shopping/orders/{id}")
public void buy(Orders orders) {...}
&lt;/code&gt;

If we went the annotation approach, we'd need to define an annotation for every possible method. An hybrid approach could be:
&lt;code&gt;
@UriTemplate("MKCOL","/shopping/orders/{id}")
public void buy(Orders orders) {...}
&lt;/code&gt;

But then it looses some of the readability.

Eric:

JAX-RS does work quite nicely with JAXB. In fact, the spec mandates that a provider must include a JAXB Element Entity Provider. So you are not limited to working with raw Documents. Otherwise, this would suck :)</description>
		<content:encoded><![CDATA[<p>This feedback is really great. I love the @Location idea! It&#8217;s a very elegant way of declaring a redirect response when creating a new resource. Awesome! </p>
<p>In regards to the @Get, @Post, @Delete, @Put annotations: the idea is great but it could also be limiting as well. The idea behind the @HttpMethod is that allows an implementation to use lesser used HTTP methods as well as those from the WebDAV spec. Therefore, one could do:<br />
<code><br />
@HttpMethod("MKCOL")<br />
@UriTemplate("/shopping/orders/{id}")<br />
public void buy(Orders orders) {...}<br />
</code></p>
<p>If we went the annotation approach, we&#8217;d need to define an annotation for every possible method. An hybrid approach could be:<br />
<code><br />
@UriTemplate("MKCOL","/shopping/orders/{id}")<br />
public void buy(Orders orders) {...}<br />
</code></p>
<p>But then it looses some of the readability.</p>
<p>Eric:</p>
<p>JAX-RS does work quite nicely with JAXB. In fact, the spec mandates that a provider must include a JAXB Element Entity Provider. So you are not limited to working with raw Documents. Otherwise, this would suck <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billburke</title>
		<link>http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-322</link>
		<dc:creator>billburke</dc:creator>
		<pubDate>Tue, 02 Oct 2007 12:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://bill.burkecentral.com/2007/10/01/jsr-311-jax-rs-comment-and-suggestions/#comment-322</guid>
		<description>Eric: 

* @UriTemplate is definable at class level
* @UriTemplates sounds good.  I'll ping Heiko
* Pretty sure JAXB bindings are there too.  There are provider plugins and XML is one of them.

Sorry I didn't go in deeper.  I'm pretty sure the links I provided here should give a lot more detail on the spec.  I just wanted to focus on specific things I want to add.</description>
		<content:encoded><![CDATA[<p>Eric: </p>
<p>* @UriTemplate is definable at class level<br />
* @UriTemplates sounds good.  I&#8217;ll ping Heiko<br />
* Pretty sure JAXB bindings are there too.  There are provider plugins and XML is one of them.</p>
<p>Sorry I didn&#8217;t go in deeper.  I&#8217;m pretty sure the links I provided here should give a lot more detail on the spec.  I just wanted to focus on specific things I want to add.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
