<?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: How to create sealed classes in Java</title>
	<atom:link href="http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 22:56:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: dibblego</title>
		<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/#comment-44</link>
		<dc:creator>dibblego</dc:creator>
		<pubDate>Tue, 11 Sep 2007 01:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=55#comment-44</guid>
		<description>Hi David,&lt;br/&gt;This trick is well known. It is called a Closed Algebraic Data Type. I once wrote about how to emulate these in Java here:&lt;br/&gt;&lt;br/&gt;http://blog.tmorris.net/maybe-in-java</description>
		<content:encoded><![CDATA[<p>Hi David,<br />This trick is well known. It is called a Closed Algebraic Data Type. I once wrote about how to emulate these in Java here:</p>
<p><a href="http://blog.tmorris.net/maybe-in-java" rel="nofollow">http://blog.tmorris.net/maybe-in-java</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David R. MacIver</title>
		<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/#comment-43</link>
		<dc:creator>David R. MacIver</dc:creator>
		<pubDate>Thu, 06 Sep 2007 07:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=55#comment-43</guid>
		<description>Well, note that Java enum instances can be made anonymous classes, so you can already add custom logic to enums as long as you don&#039;t need to add custom method signatures as well (but yes, this trick would work if you wanted custom method signatures). &lt;br/&gt;&lt;br/&gt;Glad you like it. :-)</description>
		<content:encoded><![CDATA[<p>Well, note that Java enum instances can be made anonymous classes, so you can already add custom logic to enums as long as you don&#8217;t need to add custom method signatures as well (but yes, this trick would work if you wanted custom method signatures). </p>
<p>Glad you like it. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Iry</title>
		<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/#comment-42</link>
		<dc:creator>James Iry</dc:creator>
		<pubDate>Thu, 06 Sep 2007 02:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=55#comment-42</guid>
		<description>D&#039;oh!  What&#039;s sad is I had accidentally come awefully close to this before because I used it in an elaboration of the &lt;a HREF=&quot;http://www.javapractices.com/Topic1.cjp#Legacy&quot; REL=&quot;nofollow&quot;&gt;old &quot;Java type safe enum pattern&quot;&lt;/a&gt; wherein I had not only a collection of unique values, but each value had to have some custom logic.  The result was that each enum was an instance of a unique subclass.  I had just totally forgotten about it and never thought to generalize it for sealed classes which might have multiple instances.  Thanks David!</description>
		<content:encoded><![CDATA[<p>D&#8217;oh!  What&#8217;s sad is I had accidentally come awefully close to this before because I used it in an elaboration of the <a HREF="http://www.javapractices.com/Topic1.cjp#Legacy" REL="nofollow">old &#8220;Java type safe enum pattern&#8221;</a> wherein I had not only a collection of unique values, but each value had to have some custom logic.  The result was that each enum was an instance of a unique subclass.  I had just totally forgotten about it and never thought to generalize it for sealed classes which might have multiple instances.  Thanks David!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David R. MacIver</title>
		<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/#comment-41</link>
		<dc:creator>David R. MacIver</dc:creator>
		<pubDate>Wed, 05 Sep 2007 15:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=55#comment-41</guid>
		<description>Fair enough. It seemed too simple to be original to me, but I hadn&#039;t seen it anywhere and no one else seemed to have heard of it, so I thought I&#039;d post a note. :-)&lt;br/&gt;&lt;br/&gt;(I guess more generally this is the observation that nested classes allow you to create an approximation to C++&#039;s &#039;friend&#039; status)</description>
		<content:encoded><![CDATA[<p>Fair enough. It seemed too simple to be original to me, but I hadn&#8217;t seen it anywhere and no one else seemed to have heard of it, so I thought I&#8217;d post a note. :-)</p>
<p>(I guess more generally this is the observation that nested classes allow you to create an approximation to C++&#8217;s &#8216;friend&#8217; status)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hiker</title>
		<link>http://www.drmaciver.com/2007/09/how-to-create-sealed-classes-in-java/#comment-40</link>
		<dc:creator>hiker</dc:creator>
		<pubDate>Wed, 05 Sep 2007 15:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.drmaciver.com/wordpress/?p=55#comment-40</guid>
		<description>This actually is a well known trick in the C++ community as the language doesn&#039;t offer sealed classes. Other classes can inherit from such &#039;sealed&#039; class only if they are declared as friends to it. Nice find, though.</description>
		<content:encoded><![CDATA[<p>This actually is a well known trick in the C++ community as the language doesn&#8217;t offer sealed classes. Other classes can inherit from such &#8216;sealed&#8217; class only if they are declared as friends to it. Nice find, though.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

