<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: Where&#8217;s the Real World?: Design Pattern Examples in ActionScript 3.0</title>
	<atom:link href="http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/</link>
	<description>OOP Techniques for Flash and Flex Developers</description>
	<lastBuildDate>Sat, 28 Aug 2010 21:46:42 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1656</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Thu, 19 Feb 2009 11:01:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1656</guid>
		<description>Hi Ian,

Thanks for your thoughtful comment. You&#039;ve made an excellent point, and I certainly know what you mean by Miško Hevery&#039;s examples. Sometimes we can nail an example in exactly the way you describe, but other times we think we&#039;ve got it exactly right, and someone writes us and asks, &quot;What the...?&quot; and someone else says, &quot;That&#039;s it!! Wow! Thanks.&quot; Go figure.

Both Chandima and I work with both university students and professional developers (and clients) and I suppose what we try to do is to provide several examples along two different lines. One tact is to provide fairly abstract examples so that the overall structure of a design pattern is revealed. That is so readers have a general sense of what a design pattern is attempting to accomplish. Some such examples can be found in the widely praised book &lt;em&gt;Head First Design Patterns&lt;/em&gt;. (If you have the book, take a look at the chapter on the Strategy pattern and the flying and quacking duck example. Hardly something we&#039;ll ever see in reality, but great for getting points across.) The other tact is to try and select a real world example that does several things, First, the example must clearly show how the design pattern is useful for that particular example--or more general task. Some examples do work with a particular pattern, but they&#039;re not particularly good for revealing what the pattern does or showing why it was selected. Second, the example must be universal enough that readers can see its relevance to their own work. Finally, the example needs to be a typical use of ActionScript. In the same way that LISP users expect to see some example relevant to AI, I think that ActionScript users expect to see a typical Internet example with the tools originally developed in Flash. (Yes, I know that is changing rapidly, especially with AIR--so we have to choose examples even more carefully.)

However, no matter what, we&#039;ll always get surprises. At the Montreal OOPSLA meeting a couple of years ago I presented a Flyweight example using a radar simulator much like the one on this blog. At the end of the presentation, one guy asks about a &quot;real world&quot; example, and everyone at the session turns and looks at the guy like he&#039;s a moron and say, &lt;em&gt;That is a real world example!&lt;/em&gt; So even though just about everyone gets it, some do not see the usefulness or relevance of a particular example. That&#039;s why we have several examples for each pattern in our book. On our blog, sometimes we&#039;ll have a single example and other times we&#039;ll have several. That usually depends on what we&#039;re working with, the time we have and reader interest.

Anyway, it&#039;s a topic we think about a lot and try to improve on. Your particular comment is extremely helpful because you provided a good example in Miško Hevery&#039;s work.

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Ian,</p>
<p>Thanks for your thoughtful comment. You&#8217;ve made an excellent point, and I certainly know what you mean by Miško Hevery&#8217;s examples. Sometimes we can nail an example in exactly the way you describe, but other times we think we&#8217;ve got it exactly right, and someone writes us and asks, &#8220;What the&#8230;?&#8221; and someone else says, &#8220;That&#8217;s it!! Wow! Thanks.&#8221; Go figure.</p>
<p>Both Chandima and I work with both university students and professional developers (and clients) and I suppose what we try to do is to provide several examples along two different lines. One tact is to provide fairly abstract examples so that the overall structure of a design pattern is revealed. That is so readers have a general sense of what a design pattern is attempting to accomplish. Some such examples can be found in the widely praised book <em>Head First Design Patterns</em>. (If you have the book, take a look at the chapter on the Strategy pattern and the flying and quacking duck example. Hardly something we&#8217;ll ever see in reality, but great for getting points across.) The other tact is to try and select a real world example that does several things, First, the example must clearly show how the design pattern is useful for that particular example&#8211;or more general task. Some examples do work with a particular pattern, but they&#8217;re not particularly good for revealing what the pattern does or showing why it was selected. Second, the example must be universal enough that readers can see its relevance to their own work. Finally, the example needs to be a typical use of ActionScript. In the same way that LISP users expect to see some example relevant to AI, I think that ActionScript users expect to see a typical Internet example with the tools originally developed in Flash. (Yes, I know that is changing rapidly, especially with AIR&#8211;so we have to choose examples even more carefully.)</p>
<p>However, no matter what, we&#8217;ll always get surprises. At the Montreal OOPSLA meeting a couple of years ago I presented a Flyweight example using a radar simulator much like the one on this blog. At the end of the presentation, one guy asks about a &#8220;real world&#8221; example, and everyone at the session turns and looks at the guy like he&#8217;s a moron and say, <em>That is a real world example!</em> So even though just about everyone gets it, some do not see the usefulness or relevance of a particular example. That&#8217;s why we have several examples for each pattern in our book. On our blog, sometimes we&#8217;ll have a single example and other times we&#8217;ll have several. That usually depends on what we&#8217;re working with, the time we have and reader interest.</p>
<p>Anyway, it&#8217;s a topic we think about a lot and try to improve on. Your particular comment is extremely helpful because you provided a good example in Miško Hevery&#8217;s work.</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Kinsey</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1653</link>
		<dc:creator>Ian Kinsey</dc:creator>
		<pubDate>Wed, 18 Feb 2009 23:21:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1653</guid>
		<description>Hey Bill,

I&#039;ve read your book, and I&#039;ve found about 75% of the stuff that you say useful so first let me say thanks. I had to respond to this post -- even if it is a bit late -- because I think the one thing that would make your book and your blog posts more useful is more concrete and explained examples. I read a blog you linked to in another one of your posts http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ and I think the kind of example he gives is perfect. It&#039;s concrete, stays abstract by keeping irrelevant issues black-box, and contrasts the what-to-do with the what-not-to-do.

If there&#039;s one suggestion I have for your future books it&#039;d be that you include more concrete examples. Even if you want to use FMS streaming media as an example, just use the part of the code that&#039;s relevant as an example and keep the rest of it black-box. Again, I think that post on Misko&#039;s blog is a perfect example.</description>
		<content:encoded><![CDATA[<p>Hey Bill,</p>
<p>I&#8217;ve read your book, and I&#8217;ve found about 75% of the stuff that you say useful so first let me say thanks. I had to respond to this post &#8212; even if it is a bit late &#8212; because I think the one thing that would make your book and your blog posts more useful is more concrete and explained examples. I read a blog you linked to in another one of your posts <a href="http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/" rel="nofollow">http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/</a> and I think the kind of example he gives is perfect. It&#8217;s concrete, stays abstract by keeping irrelevant issues black-box, and contrasts the what-to-do with the what-not-to-do.</p>
<p>If there&#8217;s one suggestion I have for your future books it&#8217;d be that you include more concrete examples. Even if you want to use FMS streaming media as an example, just use the part of the code that&#8217;s relevant as an example and keep the rest of it black-box. Again, I think that post on Misko&#8217;s blog is a perfect example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1571</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Thu, 12 Feb 2009 09:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1571</guid>
		<description>Hi Curro,

You know, you don&#039;t have to gobble up all of the Design Patters or OOP principles in one bite (or byte) but instead take just a little taste here and there. We plan to be thinking about and improving on our knowledge of design patterns and AS3 for a long time. So whenever you feel like it drop on by and tell us what you&#039;re up to.

Take care,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Curro,</p>
<p>You know, you don&#8217;t have to gobble up all of the Design Patters or OOP principles in one bite (or byte) but instead take just a little taste here and there. We plan to be thinking about and improving on our knowledge of design patterns and AS3 for a long time. So whenever you feel like it drop on by and tell us what you&#8217;re up to.</p>
<p>Take care,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curro</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1569</link>
		<dc:creator>Curro</dc:creator>
		<pubDate>Thu, 12 Feb 2009 06:12:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1569</guid>
		<description>Hi Bill,
It&#039;s been a time since I wrote the comment above yours. 
As soon as I read yours I began to draw a class diagram of my Quiz but I soon discovered that I had not implemented a Factory Method pattern but a costly inheriting mechanism. I tried to add another type of quiz and saw I had to rewrite the super class to fit it in.
The case is I am new to AS3 and am learning it along with design patterns. I think I am not ripe enough for them but I also think it&#039;s the way to go.
As soon as I find a decent solution to my problem I will let you know. Maybe it will be a Factory Method pattern but it could also be a Strategy pattern.

Thank you for your patience
Curro</description>
		<content:encoded><![CDATA[<p>Hi Bill,<br />
It&#8217;s been a time since I wrote the comment above yours.<br />
As soon as I read yours I began to draw a class diagram of my Quiz but I soon discovered that I had not implemented a Factory Method pattern but a costly inheriting mechanism. I tried to add another type of quiz and saw I had to rewrite the super class to fit it in.<br />
The case is I am new to AS3 and am learning it along with design patterns. I think I am not ripe enough for them but I also think it&#8217;s the way to go.<br />
As soon as I find a decent solution to my problem I will let you know. Maybe it will be a Factory Method pattern but it could also be a Strategy pattern.</p>
<p>Thank you for your patience<br />
Curro</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1499</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Thu, 05 Feb 2009 10:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1499</guid>
		<description>Hi Curro,

You happened to pick a chapter I really like (Chandima wrote it), and it had the same effect on me. Starting with an abstract example, Chandima worked out different more concrete examples of the Factory Method pattern. In working out the &quot;Take a Design Pattern to Work&quot; posts, I was able to quickly wrap my head around the Factory Method because of one particular example Chandima had made. With it I was able to go North and South——North to more precise elements in an example and South to the wider concepts involved.

Maybe you&#039;d like to share your class pattern in the form of a Class Diagram using the Quiz you created? That might help others see a solution from a different perspective. Like you said, whatever makes life easier.

Take care,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Curro,</p>
<p>You happened to pick a chapter I really like (Chandima wrote it), and it had the same effect on me. Starting with an abstract example, Chandima worked out different more concrete examples of the Factory Method pattern. In working out the &#8220;Take a Design Pattern to Work&#8221; posts, I was able to quickly wrap my head around the Factory Method because of one particular example Chandima had made. With it I was able to go North and South——North to more precise elements in an example and South to the wider concepts involved.</p>
<p>Maybe you&#8217;d like to share your class pattern in the form of a Class Diagram using the Quiz you created? That might help others see a solution from a different perspective. Like you said, whatever makes life easier.</p>
<p>Take care,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curro</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1489</link>
		<dc:creator>Curro</dc:creator>
		<pubDate>Wed, 04 Feb 2009 20:15:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1489</guid>
		<description>Hi everybody,
I am reading the book(as3dp)and have read the series on the Factory Pattern and I find the examples really useful. It is true that they are not &quot;Real World&quot; examples but they make the pattern understandable. I have tried the GoF book several times and have had to give up because I could not &quot;visualize&quot; the concepts. Now at least I understand some of the patterns and their utility. 

I have read other books about design patterns but their examples were not as appropriate as the ones discussed here. They didn&#039;t make the patterns so clear.

I am trying to apply the factory pattern to a small Quiz application with very different types of questions(from &quot;fill in the gap&quot; to &quot;drag and drop&quot;) Up to now what I had was a collection of five or six types of quiz and every time I thought of a new kind I had to rewrite all the (very similar)scoring logic once and again for every type of question. Now I hope to have one for the whole quizzing stuff no matter what type of question I devise. It is not much but it is better than nothing.

Life is a lot easier. Which is the whole point.

Thank you

Curro</description>
		<content:encoded><![CDATA[<p>Hi everybody,<br />
I am reading the book(as3dp)and have read the series on the Factory Pattern and I find the examples really useful. It is true that they are not &#8220;Real World&#8221; examples but they make the pattern understandable. I have tried the GoF book several times and have had to give up because I could not &#8220;visualize&#8221; the concepts. Now at least I understand some of the patterns and their utility. </p>
<p>I have read other books about design patterns but their examples were not as appropriate as the ones discussed here. They didn&#8217;t make the patterns so clear.</p>
<p>I am trying to apply the factory pattern to a small Quiz application with very different types of questions(from &#8220;fill in the gap&#8221; to &#8220;drag and drop&#8221;) Up to now what I had was a collection of five or six types of quiz and every time I thought of a new kind I had to rewrite all the (very similar)scoring logic once and again for every type of question. Now I hope to have one for the whole quizzing stuff no matter what type of question I devise. It is not much but it is better than nothing.</p>
<p>Life is a lot easier. Which is the whole point.</p>
<p>Thank you</p>
<p>Curro</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1429</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Fri, 30 Jan 2009 17:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1429</guid>
		<description>Hi Neil,

I agree there. Clear, applicable and nothing outside of the AS3 domain. That&#039;s probably as good a starting point as I can imagine.

Thanks for the comment,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Neil,</p>
<p>I agree there. Clear, applicable and nothing outside of the AS3 domain. That&#8217;s probably as good a starting point as I can imagine.</p>
<p>Thanks for the comment,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil Webb</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1427</link>
		<dc:creator>Neil Webb</dc:creator>
		<pubDate>Fri, 30 Jan 2009 11:57:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1427</guid>
		<description>For me the best &#039;real-world&#039; examples are ones which don&#039;t require me to install/learn anything new (and certainly nothing proprietary ... even if it has a demo).

I&#039;d be happy to see examples that didn&#039;t depend on anything other than core components and AS3. As long as the post concerns a realistic scenario, that&#039;s enough for me. Your most recent post (Iterator Pattern Example: Developing a Webpage Scraper) looks to be spot-on.

Cheers,
Neil</description>
		<content:encoded><![CDATA[<p>For me the best &#8216;real-world&#8217; examples are ones which don&#8217;t require me to install/learn anything new (and certainly nothing proprietary &#8230; even if it has a demo).</p>
<p>I&#8217;d be happy to see examples that didn&#8217;t depend on anything other than core components and AS3. As long as the post concerns a realistic scenario, that&#8217;s enough for me. Your most recent post (Iterator Pattern Example: Developing a Webpage Scraper) looks to be spot-on.</p>
<p>Cheers,<br />
Neil</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Sanders</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1419</link>
		<dc:creator>Bill Sanders</dc:creator>
		<pubDate>Fri, 30 Jan 2009 02:30:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1419</guid>
		<description>Hi Gareth,

Had I but the patience of a saint... I certainly see your point and its inherent value, but that&#039;s a lot of work! Also, it assumes that I may understand an area better than someone who&#039;s toiled in a particular field for some time--but sort of in reverse. If I pose a problem, I&#039;ve got to know enough about it to add the necessary details, and therein lies the irony. The more details I add, the more it moves away from a general problem to a highly particular and specific one.

In the comments section of this blog I&#039;ve suggested that readers follow up on comments they&#039;ve made to try it out. On only a very few have I ever got a response like, &quot;Hey, let me go work that one out!&quot;  Everyone has a better algorithm or &quot;trick&quot; but those are usually for a specific problem or what the Freemans call a &quot;Programming Idiom.&quot;

Let me make this assertion: Most ActionScript 3.0 programmers do not think in terms of the larger structures represented in design patterns. At the same time these are very smart people; so maybe the quest is to how to help, encourage and &lt;em&gt;launch&lt;/em&gt; ActionScript 3.0 programmers into a wider mindset that includes thinking more about relationships than algorithms.

Thanks for your great comment,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Gareth,</p>
<p>Had I but the patience of a saint&#8230; I certainly see your point and its inherent value, but that&#8217;s a lot of work! Also, it assumes that I may understand an area better than someone who&#8217;s toiled in a particular field for some time&#8211;but sort of in reverse. If I pose a problem, I&#8217;ve got to know enough about it to add the necessary details, and therein lies the irony. The more details I add, the more it moves away from a general problem to a highly particular and specific one.</p>
<p>In the comments section of this blog I&#8217;ve suggested that readers follow up on comments they&#8217;ve made to try it out. On only a very few have I ever got a response like, &#8220;Hey, let me go work that one out!&#8221;  Everyone has a better algorithm or &#8220;trick&#8221; but those are usually for a specific problem or what the Freemans call a &#8220;Programming Idiom.&#8221;</p>
<p>Let me make this assertion: Most ActionScript 3.0 programmers do not think in terms of the larger structures represented in design patterns. At the same time these are very smart people; so maybe the quest is to how to help, encourage and <em>launch</em> ActionScript 3.0 programmers into a wider mindset that includes thinking more about relationships than algorithms.</p>
<p>Thanks for your great comment,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Arch</title>
		<link>http://www.as3dp.com/2009/01/26/wheres-the-real-world-design-pattern-examples-in-actionscript-30/comment-page-1/#comment-1418</link>
		<dc:creator>Gareth Arch</dc:creator>
		<pubDate>Fri, 30 Jan 2009 01:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=590#comment-1418</guid>
		<description>Perhaps the method to approach this kind of user-understanding problem is to just give them the problem, let them work through the problem, get the results back, then explain why their method is wrong ( and have them explain what you identify as correct). Then rinse and repeat. This will give them a better understanding of the methodology, and a sense of accomplishment once everything is as good as can be. I like to puzzle through issues, but getting a few &quot;you may want to try this&quot; is always a welcome addition (as long as it&#039;s constructive)</description>
		<content:encoded><![CDATA[<p>Perhaps the method to approach this kind of user-understanding problem is to just give them the problem, let them work through the problem, get the results back, then explain why their method is wrong ( and have them explain what you identify as correct). Then rinse and repeat. This will give them a better understanding of the methodology, and a sense of accomplishment once everything is as good as can be. I like to puzzle through issues, but getting a few &#8220;you may want to try this&#8221; is always a welcome addition (as long as it&#8217;s constructive)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
