<?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: The Flyweight Design Pattern: Where Shared Objects Solve Storage Problems</title>
	<atom:link href="http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/</link>
	<description>OOP for Flash, Flex and AIR</description>
	<pubDate>Mon, 08 Sep 2008 14:38:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-719</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Wed, 27 Aug 2008 14:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-719</guid>
		<description>Hi Lee,

It only took me 6 months to reply, but about the time you posted your comment I was recovering from a broken leg and missed a lot of things!

As to using !=, I did mean to use that operator and not *=. Basically, it queries whether the value is undefined or not to generate a Boolean value used in a Switch statement. It's an unusual way to use Switch as Steven Sacks noted, but it's a nice clear way to illustrate the structure of the design pattern.

Thanks for your comment,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Lee,</p>
<p>It only took me 6 months to reply, but about the time you posted your comment I was recovering from a broken leg and missed a lot of things!</p>
<p>As to using !=, I did mean to use that operator and not *=. Basically, it queries whether the value is undefined or not to generate a Boolean value used in a Switch statement. It&#8217;s an unusual way to use Switch as Steven Sacks noted, but it&#8217;s a nice clear way to illustrate the structure of the design pattern.</p>
<p>Thanks for your comment,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee Hogg</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-312</link>
		<dc:creator>Lee Hogg</dc:creator>
		<pubDate>Tue, 18 Dec 2007 04:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-312</guid>
		<description>"In looking at the code, did you mean to use the *= operator or the != operator? If you did mean *="

... getIntrinsic (key:String, value:* = undefined) ...

I think "value:* = undefined" as in "optional parameter named 'value' of any type, with default value as 'undefined'".

Anyway, very interesting read. Thank you.</description>
		<content:encoded><![CDATA[<p>&#8220;In looking at the code, did you mean to use the *= operator or the != operator? If you did mean *=&#8221;</p>
<p>&#8230; getIntrinsic (key:String, value:* = undefined) &#8230;</p>
<p>I think &#8220;value:* = undefined&#8221; as in &#8220;optional parameter named &#8216;value&#8217; of any type, with default value as &#8216;undefined&#8217;&#8221;.</p>
<p>Anyway, very interesting read. Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-274</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Tue, 11 Dec 2007 16:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-274</guid>
		<description>Asa,
Thank you for your comments. Of course you are absolutely correct, and I just added such a reference at the very beginning of the article. In the three previous entries in the Flyweight Saga, I mentioned GoF and their book several times, but here it was somehow overlooked. I just assumed that everyone would know that it is based on the GoF book. That was certainly a rude oversight on my part.

However, thanks to your comments, that has been fixed and right at the beginning I make the overlooked reference!</description>
		<content:encoded><![CDATA[<p>Asa,<br />
Thank you for your comments. Of course you are absolutely correct, and I just added such a reference at the very beginning of the article. In the three previous entries in the Flyweight Saga, I mentioned GoF and their book several times, but here it was somehow overlooked. I just assumed that everyone would know that it is based on the GoF book. That was certainly a rude oversight on my part.</p>
<p>However, thanks to your comments, that has been fixed and right at the beginning I make the overlooked reference!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asa Williams</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-273</link>
		<dc:creator>Asa Williams</dc:creator>
		<pubDate>Tue, 11 Dec 2007 14:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-273</guid>
		<description>While the content of this article is great, you should really cite when you quote from a book.  Large chunks were used from "Design Patterns Elements of Reusable Object-Oriented Software"</description>
		<content:encoded><![CDATA[<p>While the content of this article is great, you should really cite when you quote from a book.  Large chunks were used from &#8220;Design Patterns Elements of Reusable Object-Oriented Software&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-268</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Mon, 10 Dec 2007 12:57:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-268</guid>
		<description>Hi Steven,

I think that's the first time I used a switch with a Boolean, and I'm trying to figure out why. At the last OOPSLA meeting in Montreal, we were bombarded with taking out conditional statements for better structure. (The State DP was mentioned as a model for ridding one of conditional statements.) Of course the switch statement is a conditional but didn't look as much like one, and maybe that was floating around in my head. (Honestly I'm just not sure!)

I really like your idea about the use of the ...rest parameter, and I'll give it a try. As for the conditional using the ternary operator, that too is interesting. In looking at the code, did you mean to use the *= operator or the != operator? If you did mean *=, that I do not understand its use in context and would love to hear how it is employed.</description>
		<content:encoded><![CDATA[<p>Hi Steven,</p>
<p>I think that&#8217;s the first time I used a switch with a Boolean, and I&#8217;m trying to figure out why. At the last OOPSLA meeting in Montreal, we were bombarded with taking out conditional statements for better structure. (The State DP was mentioned as a model for ridding one of conditional statements.) Of course the switch statement is a conditional but didn&#8217;t look as much like one, and maybe that was floating around in my head. (Honestly I&#8217;m just not sure!)</p>
<p>I really like your idea about the use of the &#8230;rest parameter, and I&#8217;ll give it a try. As for the conditional using the ternary operator, that too is interesting. In looking at the code, did you mean to use the *= operator or the != operator? If you did mean *=, that I do not understand its use in context and would love to hear how it is employed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Sacks</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-264</link>
		<dc:creator>Steven Sacks</dc:creator>
		<pubDate>Sun, 09 Dec 2007 22:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-264</guid>
		<description>Well, you need to cast that actually so you don't get compiler errors.

return Flyweight(store.hasOwnProperty(key) ? store[key : store[key] = value)</description>
		<content:encoded><![CDATA[<p>Well, you need to cast that actually so you don&#8217;t get compiler errors.</p>
<p>return Flyweight(store.hasOwnProperty(key) ? store[key : store[key] = value)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven Sacks</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-263</link>
		<dc:creator>Steven Sacks</dc:creator>
		<pubDate>Sun, 09 Dec 2007 22:48:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-263</guid>
		<description>I've never seen anyone switch a Boolean.  That's not what switch was made for.  Also, your getIntrinsic() method is not a good use of ...rest because you're only ever passing one possible argument.  

Your entire getIntrinsic() method need only be one line.


public function getIntrinsic (key:String, value:* = undefined):Flyweight 
{ 
    return store.hasOwnProperty(key) ? store[key] : store[key] = value;
}

Cheers!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve never seen anyone switch a Boolean.  That&#8217;s not what switch was made for.  Also, your getIntrinsic() method is not a good use of &#8230;rest because you&#8217;re only ever passing one possible argument.  </p>
<p>Your entire getIntrinsic() method need only be one line.</p>
<p>public function getIntrinsic (key:String, value:* = undefined):Flyweight<br />
{<br />
    return store.hasOwnProperty(key) ? store[key] : store[key] = value;<br />
}</p>
<p>Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-241</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Tue, 27 Nov 2007 13:05:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-241</guid>
		<description>Sorry about that. It's only a fraction of the materials. I hope to get the rest up today.

Bill</description>
		<content:encoded><![CDATA[<p>Sorry about that. It&#8217;s only a fraction of the materials. I hope to get the rest up today.</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: P.</title>
		<link>http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-240</link>
		<dc:creator>P.</dc:creator>
		<pubDate>Mon, 26 Nov 2007 19:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/2007/11/26/the-flyweight-design-pattern-where-shared-objects-solve-storage-problems/#comment-240</guid>
		<description>looks like figure 1 has gone off the radar...</description>
		<content:encoded><![CDATA[<p>looks like figure 1 has gone off the radar&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
