<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Jersey &#8211; a review</title>
	<atom:link href="http://twasink.net/2009/02/02/jersey-a-review/feed/" rel="self" type="application/rss+xml" />
	<link>http://twasink.net/2009/02/02/jersey-a-review/</link>
	<description>Robert&#039;s Rambling Ruminations Regarding Reality...</description>
	<lastBuildDate>Thu, 12 Apr 2012 16:31:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Ross</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-440</link>
		<dc:creator><![CDATA[Ross]]></dc:creator>
		<pubDate>Wed, 18 Mar 2009 21:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-440</guid>
		<description><![CDATA[&lt;a href=&quot;#comment-456&quot; rel=&quot;nofollow&quot;&gt;@Robert&lt;/a&gt; 

Hi, I am struggling to find documentation for even the simplest example of wiring jersey, spring and hibernate together.  Can you point me to a simple example?  I don&#039;t mind whether it places the rest annotations in the domain, or uses an intermediate model, any help would be greatly appreciated.  Thanks!]]></description>
		<content:encoded><![CDATA[<p><a href="#comment-456" rel="nofollow">@Robert</a> </p>
<p>Hi, I am struggling to find documentation for even the simplest example of wiring jersey, spring and hibernate together.  Can you point me to a simple example?  I don&#8217;t mind whether it places the rest annotations in the domain, or uses an intermediate model, any help would be greatly appreciated.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-439</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 22:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-439</guid>
		<description><![CDATA[Debbie - I&#039;ll send through a list of problem areas we had with the documentation later today. Thanks for dropping by and extending the invite.]]></description>
		<content:encoded><![CDATA[<p>Debbie &#8211; I&#8217;ll send through a list of problem areas we had with the documentation later today. Thanks for dropping by and extending the invite.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-438</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 22:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-438</guid>
		<description><![CDATA[Dave,

I put a layer of Model classes between my domain and my external views because it allows me to refactor with greater safety.

My domain classes tend to evolve over time, as my understanding of the problem domain improves. Automated refactoring tools, combined with the compiler and extensive unit tests, help ensure that this transformation is safe - within the Java code.

If I exposed the domain classes directly, then this refactoring would alter the outgoing XML and JSON (or, in a JSP world, alter the beans injected into the JSP scope). These changes are harder to detect and test to be sure they are safe. In addition, if I&#039;m using the XML as an integration point, I&#039;ll have to go and check other pieces of software.

So I put the model classes in between to allow me the freedom to change the domain without this overhead; refactoring the model classes still requires the discipline mentioned above.]]></description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>I put a layer of Model classes between my domain and my external views because it allows me to refactor with greater safety.</p>
<p>My domain classes tend to evolve over time, as my understanding of the problem domain improves. Automated refactoring tools, combined with the compiler and extensive unit tests, help ensure that this transformation is safe &#8211; within the Java code.</p>
<p>If I exposed the domain classes directly, then this refactoring would alter the outgoing XML and JSON (or, in a JSP world, alter the beans injected into the JSP scope). These changes are harder to detect and test to be sure they are safe. In addition, if I&#8217;m using the XML as an integration point, I&#8217;ll have to go and check other pieces of software.</p>
<p>So I put the model classes in between to allow me the freedom to change the domain without this overhead; refactoring the model classes still requires the discipline mentioned above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Macpherson</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-437</link>
		<dc:creator><![CDATA[Dave Macpherson]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 21:20:44 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-437</guid>
		<description><![CDATA[Thanks for the post. I&#039;ve played with Jersey a bit and find it quite interesting and useful. I have one question tho...is there a compelling reason for the introduction of JAXB-annotated model classes, as opposed to just adding the JAXB annotations to your domain classes? I found the latter sufficient, but haven&#039;t really thought about why I might want to take your approach instead. Do you feel it important to not clutter (or tie) your domain classes to JAXB due to other factors?

Dave]]></description>
		<content:encoded><![CDATA[<p>Thanks for the post. I&#8217;ve played with Jersey a bit and find it quite interesting and useful. I have one question tho&#8230;is there a compelling reason for the introduction of JAXB-annotated model classes, as opposed to just adding the JAXB annotations to your domain classes? I found the latter sufficient, but haven&#8217;t really thought about why I might want to take your approach instead. Do you feel it important to not clutter (or tie) your domain classes to JAXB due to other factors?</p>
<p>Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Debbie</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-436</link>
		<dc:creator><![CDATA[Debbie]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 20:52:52 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-436</guid>
		<description><![CDATA[Hi, Robert, I&#039;m working on some documentation for Jersey, so I&#039;m hoping to get more detail on what didn&#039;t work for you with regard to what currently exists.  We wanted to use the Jersey wiki page (http://wikis.sun.com/display/Jersey/Main) as the primary location for Jersey documentation so that community members could easily add or edit the existing documentation, and this page has links to all of the other documentation, such as the RESTful Web Services Developer&#039;s Guide, which ships with GlassFish.  Anyway, if you could provide a bit more info on what made the docs &quot;sketchy&quot;, I&#039;ll work to improve them. Thanks for the feedback.]]></description>
		<content:encoded><![CDATA[<p>Hi, Robert, I&#8217;m working on some documentation for Jersey, so I&#8217;m hoping to get more detail on what didn&#8217;t work for you with regard to what currently exists.  We wanted to use the Jersey wiki page (<a href="http://wikis.sun.com/display/Jersey/Main" rel="nofollow">http://wikis.sun.com/display/Jersey/Main</a>) as the primary location for Jersey documentation so that community members could easily add or edit the existing documentation, and this page has links to all of the other documentation, such as the RESTful Web Services Developer&#8217;s Guide, which ships with GlassFish.  Anyway, if you could provide a bit more info on what made the docs &#8220;sketchy&#8221;, I&#8217;ll work to improve them. Thanks for the feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-435</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 11:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-435</guid>
		<description><![CDATA[Jakub, thanks for the reply. I was aware of the option of passing through element names that should be arrays, but found it too cumbersome. In addition, that was one of several issues we had with the defined formats.

My solution is not superior, or even suitable for Jersey generally as the JSON it produces would be hard to parse back to Java code, but it&#039;s a bit easier to deal with as a Javascript client. The natural notation sounds interesting, and I will definitely check it out.]]></description>
		<content:encoded><![CDATA[<p>Jakub, thanks for the reply. I was aware of the option of passing through element names that should be arrays, but found it too cumbersome. In addition, that was one of several issues we had with the defined formats.</p>
<p>My solution is not superior, or even suitable for Jersey generally as the JSON it produces would be hard to parse back to Java code, but it&#8217;s a bit easier to deal with as a Javascript client. The natural notation sounds interesting, and I will definitely check it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jakub</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-434</link>
		<dc:creator><![CDATA[Jakub]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 08:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-434</guid>
		<description><![CDATA[&lt;a href=&quot;#comment-447&quot; rel=&quot;nofollow&quot;&gt;@Robert&lt;/a&gt; 
The issue with &quot;foo&quot;: &quot;bar&quot; (list of one) has a workaround. You can configure (see &lt;a href=&quot;https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.1/api/jersey/com/sun/jersey/api/json/JSONJAXBContext.html&quot; rel=&quot;nofollow&quot;&gt;JSONJAXBContext javadoc&lt;/a&gt; the JSON processor with a list of array representing elements, and it will do the right thing. I have also recently added a new (NATURAL) notation to Jersey, which takes advantage of better integration with the newest JAXB RI. Then you do not need to configure anything and still get your array serialized correctly as &quot;foo&quot;:[&quot;bar&quot;] ]]></description>
		<content:encoded><![CDATA[<p><a href="#comment-447" rel="nofollow">@Robert</a><br />
The issue with &#8220;foo&#8221;: &#8220;bar&#8221; (list of one) has a workaround. You can configure (see <a href="https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.1/api/jersey/com/sun/jersey/api/json/JSONJAXBContext.html" rel="nofollow">JSONJAXBContext javadoc</a> the JSON processor with a list of array representing elements, and it will do the right thing. I have also recently added a new (NATURAL) notation to Jersey, which takes advantage of better integration with the newest JAXB RI. Then you do not need to configure anything and still get your array serialized correctly as &#8220;foo&#8221;:["bar"] </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-433</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 07:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-433</guid>
		<description><![CDATA[I got used to the request path from using annotated Spring MVC. There it wasn&#039;t a problem. It&#039;s worth pointing out that you can do these mappings via descriptors as well (including overriding the annotation), so the mapping is more of a convenience than a necessity.

Personally, I&#039;m heading down the path of saying that relative URLs within the app aren&#039;t really configuration.

Re: line 17. In an AJAX app, I may want a HTML request to, say, /hotel/1234/ to bring back the content (HTML, CSS, javascript). This content could be entirely static, with all the dynamic behaviour coming from the javascript interpreting the JSON data. Being able to do content negotiation at that level means I can avoid hitting a method that will load content from the database, if that&#039;s not necessary. Of course, in the example above, I don&#039;t do that.

As for discoverable &quot;next actions&quot; - that comes down to what you have in your outgoing model. So, for example, you&#039;d want to put in &quot;link&quot; elements - which presumably would be relative (and another good reason to have the URLs within the app not treated as configuration). You also get some &quot;next actions&quot; via convention - e.g to update a hotel, do a POST.]]></description>
		<content:encoded><![CDATA[<p>I got used to the request path from using annotated Spring MVC. There it wasn&#8217;t a problem. It&#8217;s worth pointing out that you can do these mappings via descriptors as well (including overriding the annotation), so the mapping is more of a convenience than a necessity.</p>
<p>Personally, I&#8217;m heading down the path of saying that relative URLs within the app aren&#8217;t really configuration.</p>
<p>Re: line 17. In an AJAX app, I may want a HTML request to, say, /hotel/1234/ to bring back the content (HTML, CSS, javascript). This content could be entirely static, with all the dynamic behaviour coming from the javascript interpreting the JSON data. Being able to do content negotiation at that level means I can avoid hitting a method that will load content from the database, if that&#8217;s not necessary. Of course, in the example above, I don&#8217;t do that.</p>
<p>As for discoverable &#8220;next actions&#8221; &#8211; that comes down to what you have in your outgoing model. So, for example, you&#8217;d want to put in &#8220;link&#8221; elements &#8211; which presumably would be relative (and another good reason to have the URLs within the app not treated as configuration). You also get some &#8220;next actions&#8221; via convention &#8211; e.g to update a hotel, do a POST.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scot</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-432</link>
		<dc:creator><![CDATA[scot]]></dc:creator>
		<pubDate>Tue, 03 Feb 2009 06:27:55 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-432</guid>
		<description><![CDATA[how do you find the practice of embedding the request path straight into the class via an annotation? personally, this pattern seems to violate principles of keeping configuration separate from code, especially when you might otherwise be able to use the same class on another path? maybe that&#039;s unneccesary in this case? 

Also perhaps you can elucidate on the basis of the comment about line 17? Is this related to the mapping of the views from the model class that you mention as being the third thing you like about it? Would this mean, a different method per view rendering even if it&#039;s the same object being rendered?

How does it allow for discoverable &#039;next actions&#039;?]]></description>
		<content:encoded><![CDATA[<p>how do you find the practice of embedding the request path straight into the class via an annotation? personally, this pattern seems to violate principles of keeping configuration separate from code, especially when you might otherwise be able to use the same class on another path? maybe that&#8217;s unneccesary in this case? </p>
<p>Also perhaps you can elucidate on the basis of the comment about line 17? Is this related to the mapping of the views from the model class that you mention as being the third thing you like about it? Would this mean, a different method per view rendering even if it&#8217;s the same object being rendered?</p>
<p>How does it allow for discoverable &#8216;next actions&#8217;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2009/02/02/jersey-a-review/#comment-431</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Mon, 02 Feb 2009 22:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/blog/?p=608#comment-431</guid>
		<description><![CDATA[I haven&#039;t tried XStream as a JSON writer - we have used it for XML in the past, and found it a little awkward. For the work I&#039;m currently doing, I&#039;m using json-lib; we&#039;d used that on an earlier project and I was very happy with the resulting JSON.

In fact, the biggest problem with it I&#039;m having right now is that JAXB doesn&#039;t understand maps properly. This means my model classes look just a little odd when I want a map effect.]]></description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tried XStream as a JSON writer &#8211; we have used it for XML in the past, and found it a little awkward. For the work I&#8217;m currently doing, I&#8217;m using json-lib; we&#8217;d used that on an earlier project and I was very happy with the resulting JSON.</p>
<p>In fact, the biggest problem with it I&#8217;m having right now is that JAXB doesn&#8217;t understand maps properly. This means my model classes look just a little odd when I want a map effect.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

