<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Getting rid of switch statements with Java Enums</title>
	<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/</link>
	<description>Thoughtworker, Agile Philosopher, Hero</description>
	<pubDate>Wed, 08 Sep 2010 05:42:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Jonathan Marler</title>
		<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-10874</link>
		<dc:creator>Jonathan Marler</dc:creator>
		<pubDate>Thu, 15 Apr 2010 21:04:17 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-10874</guid>
		<description>Very useful, a great natural design for using enums.

Also, this is not a big deal, but in order to compile your example I had to add a semi-colon at the end of line 7. 

1.enum Friend {
2.    Joey {
3.        Friend bestFriend() { return Chandler; }
4.    },
5.    Chandler {
6.        Friend bestFriend() { return Joey; }
7.    }
8.    abstract Friend bestFriend();
9.}</description>
		<content:encoded><![CDATA[<p>Very useful, a great natural design for using enums.</p>
<p>Also, this is not a big deal, but in order to compile your example I had to add a semi-colon at the end of line 7. </p>
<p>1.enum Friend {<br />
2.    Joey {<br />
3.        Friend bestFriend() { return Chandler; }<br />
4.    },<br />
5.    Chandler {<br />
6.        Friend bestFriend() { return Joey; }<br />
7.    }<br />
8.    abstract Friend bestFriend();<br />
9.}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Bartmann</title>
		<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-7267</link>
		<dc:creator>Bill Bartmann</dc:creator>
		<pubDate>Thu, 03 Sep 2009 16:36:35 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-7267</guid>
		<description>Cool site, love the info.</description>
		<content:encoded><![CDATA[<p>Cool site, love the info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kemper</title>
		<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-6480</link>
		<dc:creator>Kris Kemper</dc:creator>
		<pubDate>Thu, 23 Jul 2009 02:05:42 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-6480</guid>
		<description>Thanks Vivek! I generated the code using Jad - decompiler for eclipse. It became hard to find for a while since the main website went down, but there are mirrors for it now. Check out: http://www.varaneckas.com/jad</description>
		<content:encoded><![CDATA[<p>Thanks Vivek! I generated the code using Jad - decompiler for eclipse. It became hard to find for a while since the main website went down, but there are mirrors for it now. Check out: <a href="http://www.varaneckas.com/jad" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://www.varaneckas.com/jad');" rel="nofollow">http://www.varaneckas.com/jad</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vivek</title>
		<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-6435</link>
		<dc:creator>vivek</dc:creator>
		<pubDate>Tue, 21 Jul 2009 06:22:38 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-6435</guid>
		<description>good article.  I don't know how you got the generated code for Enum but it is useful to see how Enum are treated internally.  Makes it very clear that each enum is a full fledged object instance.</description>
		<content:encoded><![CDATA[<p>good article.  I don&#8217;t know how you got the generated code for Enum but it is useful to see how Enum are treated internally.  Makes it very clear that each enum is a full fledged object instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry Kandalov</title>
		<link>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-1019</link>
		<dc:creator>Dmitry Kandalov</dc:creator>
		<pubDate>Mon, 20 Oct 2008 12:31:18 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/10/19/getting-rid-of-switch-statements-with-java-enums/#comment-1019</guid>
		<description>Great post. I've had a similar problem with enums but I didn't dig so deep why forward referencing doesn't work.

enum Friend {
	Joey(Friend.Chandler),
	Chandler(Joey);
...
}
won't compile with Sun compiler (jdk1.6_06). So using anonymous enums is probably the only way to go.</description>
		<content:encoded><![CDATA[<p>Great post. I&#8217;ve had a similar problem with enums but I didn&#8217;t dig so deep why forward referencing doesn&#8217;t work.</p>
<p>enum Friend {<br />
	Joey(Friend.Chandler),<br />
	Chandler(Joey);<br />
&#8230;<br />
}<br />
won&#8217;t compile with Sun compiler (jdk1.6_06). So using anonymous enums is probably the only way to go.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
