<?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/"
		>
<channel>
	<title>Comments on: JsonBuilder for Scala, REST and Jersey</title>
	<atom:link href="http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/feed/" rel="self" type="application/rss+xml" />
	<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/</link>
	<description></description>
	<lastBuildDate>Mon, 15 Mar 2010 13:03:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pstickne</title>
		<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/comment-page-1/#comment-178176</link>
		<dc:creator>pstickne</dc:creator>
		<pubDate>Sat, 11 Oct 2008 03:56:17 +0000</pubDate>
		<guid isPermaLink="false">http://stephan.reposita.org/archives/2008/09/18/jsonbuilder-for-scala-rest-and-jersey/#comment-178176</guid>
		<description>I think the &quot;def foo() {}&quot; syntax is clear after it&#039;s been used a few times. One issue that -has- bitten me a few times is the auto-coercion of any type to Unit. However, this would be the same even issue if I was using &quot;def foo(): Unit = {}&quot;.</description>
		<content:encoded><![CDATA[<p>I think the &#8220;def foo() {}&#8221; syntax is clear after it&#8217;s been used a few times. One issue that -has- bitten me a few times is the auto-coercion of any type to Unit. However, this would be the same even issue if I was using &#8220;def foo(): Unit = {}&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/comment-page-1/#comment-174270</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 02 Oct 2008 21:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://stephan.reposita.org/archives/2008/09/18/jsonbuilder-for-scala-rest-and-jersey/#comment-174270</guid>
		<description>@Chekke: Scala. Yes you should :-)</description>
		<content:encoded><![CDATA[<p>@Chekke: Scala. Yes you should :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chekke</title>
		<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/comment-page-1/#comment-174205</link>
		<dc:creator>Chekke</dc:creator>
		<pubDate>Thu, 02 Oct 2008 18:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://stephan.reposita.org/archives/2008/09/18/jsonbuilder-for-scala-rest-and-jersey/#comment-174205</guid>
		<description>Stephan the first block of code it is Groovy or Scala? If is Scala it is a beauty to be a statically type language.

I should take a look more seriously to Scala.</description>
		<content:encoded><![CDATA[<p>Stephan the first block of code it is Groovy or Scala? If is Scala it is a beauty to be a statically type language.</p>
<p>I should take a look more seriously to Scala.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stephan</title>
		<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/comment-page-1/#comment-168902</link>
		<dc:creator>stephan</dc:creator>
		<pubDate>Thu, 18 Sep 2008 13:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://stephan.reposita.org/archives/2008/09/18/jsonbuilder-for-scala-rest-and-jersey/#comment-168902</guid>
		<description>Ah thanks.

Concerning the Unit syntax. As written before, I&#039;m not sure type inference is always a good thing. 

And especially as return types type declarations might be useful. Not to the compiler, but to the person who is reading a method.

val a = b.something()

is fine in my code

When someone wants to use something

def something():Int 

might be easier to use than

def something()

Code is always written to be easily read and understood, not by optimizing the keys one needs to type.</description>
		<content:encoded><![CDATA[<p>Ah thanks.</p>
<p>Concerning the Unit syntax. As written before, I&#8217;m not sure type inference is always a good thing. </p>
<p>And especially as return types type declarations might be useful. Not to the compiler, but to the person who is reading a method.</p>
<p>val a = b.something()</p>
<p>is fine in my code</p>
<p>When someone wants to use something</p>
<p>def something():Int </p>
<p>might be easier to use than</p>
<p>def something()</p>
<p>Code is always written to be easily read and understood, not by optimizing the keys one needs to type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Spiewak</title>
		<link>http://codemonkeyism.com/jsonbuilder-for-scala-rest-and-jersey/comment-page-1/#comment-168784</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Thu, 18 Sep 2008 08:48:25 +0000</pubDate>
		<guid isPermaLink="false">http://stephan.reposita.org/archives/2008/09/18/jsonbuilder-for-scala-rest-and-jersey/#comment-168784</guid>
		<description>If you&#039;re using the Scala Array class, then passing values into Java requires nothing more than a Java method which accepts a corresponding Java array.  This works because Scala arrays are *literally* Java arrays, just with a little sugar built on top.  The nice thing about this is you don&#039;t have to worry about translation between languages, just pass values through.

Other collection types are a bit trickier, but the good news is that you don&#039;t *really* need to convert anything, so long as you&#039;re willing to call Scala APIs from Java (which works perfectly, it&#039;s just not good ol&#039; java.util.List).  Going the other direction is actually even easier (if that&#039;s possible) since Scala includes wrappers for all of the Java Collections interfaces.  These wrappers (in scala.collection.jcl) are automatically invoked (via implicit conversion) to wrap Java collections in more palatable Scala interfaces.  Thus, while it is not possible to pass a java.util.List into a Scala method accepting Seq *from Java*, it should be fairly easy to just pass that same list into a Scala method which accepts that type, and then from there pass the list to the final target method (accepting Seq).

Stylistic note: any method which returns type Unit should be declared using the following special syntax.  It&#039;s not only shorter and more readable, but it can also prevent subtle mistakes when relying on type inference:

def doSomething() {
  // do whatever I want
  // return whatever I want...
  // ...because it&#039;s thrown away
}

This is semantically identical to the following:

def doSomething(): Unit = {
  // do whatever I want
  // return whatever I want...
  () // ...because it&#039;s thrown away
}

Obviously, the first one is nicer.  :-)</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using the Scala Array class, then passing values into Java requires nothing more than a Java method which accepts a corresponding Java array.  This works because Scala arrays are *literally* Java arrays, just with a little sugar built on top.  The nice thing about this is you don&#8217;t have to worry about translation between languages, just pass values through.</p>
<p>Other collection types are a bit trickier, but the good news is that you don&#8217;t *really* need to convert anything, so long as you&#8217;re willing to call Scala APIs from Java (which works perfectly, it&#8217;s just not good ol&#8217; java.util.List).  Going the other direction is actually even easier (if that&#8217;s possible) since Scala includes wrappers for all of the Java Collections interfaces.  These wrappers (in scala.collection.jcl) are automatically invoked (via implicit conversion) to wrap Java collections in more palatable Scala interfaces.  Thus, while it is not possible to pass a java.util.List into a Scala method accepting Seq *from Java*, it should be fairly easy to just pass that same list into a Scala method which accepts that type, and then from there pass the list to the final target method (accepting Seq).</p>
<p>Stylistic note: any method which returns type Unit should be declared using the following special syntax.  It&#8217;s not only shorter and more readable, but it can also prevent subtle mistakes when relying on type inference:</p>
<p>def doSomething() {<br />
  // do whatever I want<br />
  // return whatever I want&#8230;<br />
  // &#8230;because it&#8217;s thrown away<br />
}</p>
<p>This is semantically identical to the following:</p>
<p>def doSomething(): Unit = {<br />
  // do whatever I want<br />
  // return whatever I want&#8230;<br />
  () // &#8230;because it&#8217;s thrown away<br />
}</p>
<p>Obviously, the first one is nicer.  :-)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
