<?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: Primitive Obsession II: (Im)mutability and Redefining Primitive</title>
	<atom:link href="http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/</link>
	<description>Daniel Pitts' Tech Blog</description>
	<pubDate>Sat, 22 Nov 2008 03:35:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Aviad Ben Dov</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-75</link>
		<dc:creator>Aviad Ben Dov</dc:creator>
		<pubDate>Tue, 11 Dec 2007 12:09:16 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-75</guid>
		<description>It's true unless your work is all around cycles, where they become precious, but you still want to work with Java and not C or some other low-level language. 

Take a look at a project called Javoloution which does just that.</description>
		<content:encoded><![CDATA[<p>It&#8217;s true unless your work is all around cycles, where they become precious, but you still want to work with Java and not C or some other low-level language. </p>
<p>Take a look at a project called Javoloution which does just that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-73</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Mon, 10 Dec 2007 16:28:07 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-73</guid>
		<description>The JVM has become so good at managing memory, that its considered dangerous to use object pools, as it could actually disrupt the GC's normal processing.  However, they point is that unless a profiler tells you that object-creation of this particular type is what's taking up all your time, don't bother optimizing it.  Cycles aren't the precious commodity they used to be.</description>
		<content:encoded><![CDATA[<p>The JVM has become so good at managing memory, that its considered dangerous to use object pools, as it could actually disrupt the GC&#8217;s normal processing.  However, they point is that unless a profiler tells you that object-creation of this particular type is what&#8217;s taking up all your time, don&#8217;t bother optimizing it.  Cycles aren&#8217;t the precious commodity they used to be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aviad Ben Dov</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-71</link>
		<dc:creator>Aviad Ben Dov</dc:creator>
		<pubDate>Mon, 10 Dec 2007 12:50:55 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-71</guid>
		<description>Also, to answer the question about overheads of objects, its true that there's an overhead but there are two benefits for immutable objects: first, they can use the flyweight design pattern very easily (see Integer.valueOf and the likes, so that there would be an Angle.valueOf(double) that would return very common angles as flyweight instances). Second, they can use an object pool of internally mutable objects, so that "Angle.valueOf" would ask the pool for an Angle with a certain degree and would receive a previously allocated object, modified to the angle required. That would save quite a lot of time for the virtual memory manager, reducing the strain on the system.</description>
		<content:encoded><![CDATA[<p>Also, to answer the question about overheads of objects, its true that there&#8217;s an overhead but there are two benefits for immutable objects: first, they can use the flyweight design pattern very easily (see Integer.valueOf and the likes, so that there would be an Angle.valueOf(double) that would return very common angles as flyweight instances). Second, they can use an object pool of internally mutable objects, so that &#8220;Angle.valueOf&#8221; would ask the pool for an Angle with a certain degree and would receive a previously allocated object, modified to the angle required. That would save quite a lot of time for the virtual memory manager, reducing the strain on the system.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aviad Ben Dov</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-70</link>
		<dc:creator>Aviad Ben Dov</dc:creator>
		<pubDate>Mon, 10 Dec 2007 12:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-70</guid>
		<description>I think that you brought a lot of good points. I think that in this case, another good point can be made for Boolean values: A lot of the times boolean values are used but without a lot of readable sense. For example, the following: "new DatabaseTable("my_table", true, false, true)" or: "new DatabaseTable("my_table", CACHED, NO_FAULTING, AUTOMATIC_TRANSACTIONS)".

The idea is to use Enums where reasonable to depict true/false values, to make the application (a) more readable, and (b) more robust for future changes (if an intermediate value is suddenly required).</description>
		<content:encoded><![CDATA[<p>I think that you brought a lot of good points. I think that in this case, another good point can be made for Boolean values: A lot of the times boolean values are used but without a lot of readable sense. For example, the following: &#8220;new DatabaseTable(&#8221;my_table&#8221;, true, false, true)&#8221; or: &#8220;new DatabaseTable(&#8221;my_table&#8221;, CACHED, NO_FAULTING, AUTOMATIC_TRANSACTIONS)&#8221;.</p>
<p>The idea is to use Enums where reasonable to depict true/false values, to make the application (a) more readable, and (b) more robust for future changes (if an intermediate value is suddenly required).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-12</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 06 Nov 2007 01:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-12</guid>
		<description>@Roedy
Thanks for the feedback.  It was kind of meandering, and I should structure it a bit better. As for the overhead of using objects, my main goal is to describe good OO architecture/design. My personal preference is to use objects in all cases, unless you find, through proper profiling, that using the object version causes problems.</description>
		<content:encoded><![CDATA[<p>@Roedy<br />
Thanks for the feedback.  It was kind of meandering, and I should structure it a bit better. As for the overhead of using objects, my main goal is to describe good OO architecture/design. My personal preference is to use objects in all cases, unless you find, through proper profiling, that using the object version causes problems.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roedy Green</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-11</link>
		<dc:creator>Roedy Green</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-11</guid>
		<description>The essay needs to have the structure:
1. tell them what you are going to tell them.
2. tell them
3. tell them what you told them.

The way it is written, it is frustrating not knowing where it is headed or what the essential point is.
It feels very meandering. 

You also ignore the key issue of overhead of using objects instead of primitives. How do you decide which to use in any given case?</description>
		<content:encoded><![CDATA[<p>The essay needs to have the structure:<br />
1. tell them what you are going to tell them.<br />
2. tell them<br />
3. tell them what you told them.</p>
<p>The way it is written, it is frustrating not knowing where it is headed or what the essential point is.<br />
It feels very meandering. </p>
<p>You also ignore the key issue of overhead of using objects instead of primitives. How do you decide which to use in any given case?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roedy Green</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-10</link>
		<dc:creator>Roedy Green</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-10</guid>
		<description>"value in a specific set of real,"
should be
"value in a specific set of reals,"</description>
		<content:encoded><![CDATA[<p>&#8220;value in a specific set of real,&#8221;<br />
should be<br />
&#8220;value in a specific set of reals,&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roedy Green</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-9</link>
		<dc:creator>Roedy Green</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-9</guid>
		<description>"Just as Integer object"
should be 
"Just as an Integer object"</description>
		<content:encoded><![CDATA[<p>&#8220;Just as Integer object&#8221;<br />
should be<br />
&#8220;Just as an Integer object&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roedy Green</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-8</link>
		<dc:creator>Roedy Green</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-8</guid>
		<description>"Lets say that I have a value that represents an angle."
should be
"Let's say that I have a value that represents an angle."</description>
		<content:encoded><![CDATA[<p>&#8220;Lets say that I have a value that represents an angle.&#8221;<br />
should be<br />
&#8220;Let&#8217;s say that I have a value that represents an angle.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roedy Green</title>
		<link>http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-7</link>
		<dc:creator>Roedy Green</dc:creator>
		<pubDate>Mon, 05 Nov 2007 21:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://virtualinfinity.net/wordpress/program-design/2007/11/04/primitive-obsession-2/#comment-7</guid>
		<description>"to represent you data".
should be  "to represent your data"</description>
		<content:encoded><![CDATA[<p>&#8220;to represent you data&#8221;.<br />
should be  &#8220;to represent your data&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
