<?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: Truckin’ Through ActionScript 3.0 MVC: Part V—Purpose and Use</title>
	<atom:link href="http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/</link>
	<description>OOP Techniques for Flash and Flex Developers</description>
	<lastBuildDate>Wed, 10 Mar 2010 17:32:01 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Curro</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3741</link>
		<dc:creator>Curro</dc:creator>
		<pubDate>Tue, 29 Dec 2009 21:09:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3741</guid>
		<description>Hi everybody,
I have refactored the compass program following what Chandima does in chapter 12 of &quot;ActonScript 3.0 Design Patterns&quot; (which btw I find more useful and learner friendly than HeadFirst into Patterns(with all my compliments to its authors, though)).
So I use the ComponentView class from chapter 12 and subclass from them AnalogView and RetroView I have also brought CompositeView and I subclass from it a new SliderLeafView class which deals with the slider. I have taken out the slider-related code from both AnalogView and RetroView(now called ClassicLeafView and DigitalLeafView) and that&#039;s it!

Well, not exactly; I also had to take out the declarations of the controller and the model vars from all the subclasses.

I am really happy because I have learnt a lot reading that chapter. It has also been very useful for me. I have refactored a really clumsy little program of mine into a mvc pattern and it is now elegant and easy to modify/extend.

Thank you</description>
		<content:encoded><![CDATA[<p>Hi everybody,<br />
I have refactored the compass program following what Chandima does in chapter 12 of &#8220;ActonScript 3.0 Design Patterns&#8221; (which btw I find more useful and learner friendly than HeadFirst into Patterns(with all my compliments to its authors, though)).<br />
So I use the ComponentView class from chapter 12 and subclass from them AnalogView and RetroView I have also brought CompositeView and I subclass from it a new SliderLeafView class which deals with the slider. I have taken out the slider-related code from both AnalogView and RetroView(now called ClassicLeafView and DigitalLeafView) and that&#8217;s it!</p>
<p>Well, not exactly; I also had to take out the declarations of the controller and the model vars from all the subclasses.</p>
<p>I am really happy because I have learnt a lot reading that chapter. It has also been very useful for me. I have refactored a really clumsy little program of mine into a mvc pattern and it is now elegant and easy to modify/extend.</p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3604</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Sun, 06 Dec 2009 20:56:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3604</guid>
		<description>Hi there Dyei Nightmare,

Well, it&#039;s fine if you want to promote a book on design patterns you like. However, we don&#039;t feel that you were very fair to us in claiming that we were verbose in explaining design patterns for ActionScript 3.0. We are not using a lot of words to explain &quot;simple things&quot; or using several lines that &quot;can be told in a few lines.&quot; (&lt;em&gt;Egocentric monologe?&lt;/em&gt; Outch! You hurt our feelings by such unkind words.)

The very first sentence in the Gang of Four&#039;s book is,
&lt;blockquote&gt;Designing object-oriented software is hard, and designing &lt;em&gt;reusable&lt;/em&gt; object-oriented software is even harder.&lt;/blockquote&gt; So, forget about explaining &lt;em&gt;simple things&lt;/em&gt;. We&#039;re dealing with &lt;em&gt;hard things&lt;/em&gt; and trying to do so adequately. Chandima and I had our egos stomped on in preparing our book (and our blog) because we both realized that we were dealing with some very smart folks.

As always, we&#039;re interested in good books on design patterns and welcome one and all. The main book that we rely on is &lt;em&gt;Design Patterns: Elements of Reusable Object-Oriented Software&lt;/em&gt; by Gamma, Helm, Johnson  and Vlissides. However, we have also found that the Freeman&#039;s book, &lt;em&gt;Head First Design Patterns&lt;/em&gt; is also excellent. Both take very different approaches and use different languages; Softtalk-80 and Java, respectively. Our goal in writing our book (and this blog) is to address the issues of creating design patterns using ActionScript 3.0 doing our best to combine principles of programming in OOP and the structures in design patterns.

We certainly do not compete with (or malign) &lt;em&gt;Design Patterns for Dummies&lt;/em&gt;. We&#039;re simply dealing with &lt;em&gt;smarties&lt;/em&gt; and so our approach is a bit different.

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi there Dyei Nightmare,</p>
<p>Well, it&#8217;s fine if you want to promote a book on design patterns you like. However, we don&#8217;t feel that you were very fair to us in claiming that we were verbose in explaining design patterns for ActionScript 3.0. We are not using a lot of words to explain &#8220;simple things&#8221; or using several lines that &#8220;can be told in a few lines.&#8221; (<em>Egocentric monologe?</em> Outch! You hurt our feelings by such unkind words.)</p>
<p>The very first sentence in the Gang of Four&#8217;s book is,</p>
<blockquote><p>Designing object-oriented software is hard, and designing <em>reusable</em> object-oriented software is even harder.</p></blockquote>
<p> So, forget about explaining <em>simple things</em>. We&#8217;re dealing with <em>hard things</em> and trying to do so adequately. Chandima and I had our egos stomped on in preparing our book (and our blog) because we both realized that we were dealing with some very smart folks.</p>
<p>As always, we&#8217;re interested in good books on design patterns and welcome one and all. The main book that we rely on is <em>Design Patterns: Elements of Reusable Object-Oriented Software</em> by Gamma, Helm, Johnson  and Vlissides. However, we have also found that the Freeman&#8217;s book, <em>Head First Design Patterns</em> is also excellent. Both take very different approaches and use different languages; Softtalk-80 and Java, respectively. Our goal in writing our book (and this blog) is to address the issues of creating design patterns using ActionScript 3.0 doing our best to combine principles of programming in OOP and the structures in design patterns.</p>
<p>We certainly do not compete with (or malign) <em>Design Patterns for Dummies</em>. We&#8217;re simply dealing with <em>smarties</em> and so our approach is a bit different.</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dyei nightmare</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3603</link>
		<dc:creator>dyei nightmare</dc:creator>
		<pubDate>Sun, 06 Dec 2009 18:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3603</guid>
		<description>hi, i was reading your book, while it has good learning resources, the book by itself is very bad, a lot of words to explain simple things, a lot of paragraphs to explain something that can be told in a few lines. is more an egocentric monologe than a real purpose of teaching.

if you people want to see an exelent book, maybe the best, about design patterns, go for: “desing patters for dummies” is java oriented, but is by far, the best book about this topic

 h t t p://www.amazon.com/Design-Patterns-Dummies-Computer-Tech/dp/0471798541</description>
		<content:encoded><![CDATA[<p>hi, i was reading your book, while it has good learning resources, the book by itself is very bad, a lot of words to explain simple things, a lot of paragraphs to explain something that can be told in a few lines. is more an egocentric monologe than a real purpose of teaching.</p>
<p>if you people want to see an exelent book, maybe the best, about design patterns, go for: “desing patters for dummies” is java oriented, but is by far, the best book about this topic</p>
<p> h t t p://www.amazon.com/Design-Patterns-Dummies-Computer-Tech/dp/0471798541</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3533</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Wed, 02 Dec 2009 13:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3533</guid>
		<description>Hi Chandima,

Thank you for the precision !, happy if it is an usual pratice, I will now use it with less wondering if I do something wrong.

Patrick</description>
		<content:encoded><![CDATA[<p>Hi Chandima,</p>
<p>Thank you for the precision !, happy if it is an usual pratice, I will now use it with less wondering if I do something wrong.</p>
<p>Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chandima Cumaranatunge</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3526</link>
		<dc:creator>Chandima Cumaranatunge</dc:creator>
		<pubDate>Wed, 02 Dec 2009 04:47:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3526</guid>
		<description>Hi Patrick,

It is not uncommon to implement the controller in the MVC architecture as a command pattern. In fact many AS3/Flex frameworks such as PureMVC and Cairngorm do this.</description>
		<content:encoded><![CDATA[<p>Hi Patrick,</p>
<p>It is not uncommon to implement the controller in the MVC architecture as a command pattern. In fact many AS3/Flex frameworks such as PureMVC and Cairngorm do this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3516</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 01 Dec 2009 21:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3516</guid>
		<description>Hi,

I finnaly made a try with the Command Pattern and a sort of MVC and I find it&#039;s interesting.
Simply, the Command Pattern changes the Model data and activates its functions, then the Model dispatches the usual &quot;change&quot; events that update the View.

So it&#039;s the Model View Command :)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I finnaly made a try with the Command Pattern and a sort of MVC and I find it&#8217;s interesting.<br />
Simply, the Command Pattern changes the Model data and activates its functions, then the Model dispatches the usual &#8220;change&#8221; events that update the View.</p>
<p>So it&#8217;s the Model View Command :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3305</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Tue, 10 Nov 2009 02:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3305</guid>
		<description>Hi again Archont,

I&#039;m a very big advocate of loose coupling because with it it&#039;s easier to update and change; the purpose of design patterns. However, I&#039;ll not quibble with any idea you have, and if you want to tighten the coupling go ahead. I&#039;m &lt;em&gt;very&lt;/em&gt; glad you&#039;ll not include Singletons—I&#039;ve made my views on the Singleton quite clear.

Our blog welcomes ideas and discourse; so do it any way you see fit, and we&#039;ll show it off.

Take care,
Bill</description>
		<content:encoded><![CDATA[<p>Hi again Archont,</p>
<p>I&#8217;m a very big advocate of loose coupling because with it it&#8217;s easier to update and change; the purpose of design patterns. However, I&#8217;ll not quibble with any idea you have, and if you want to tighten the coupling go ahead. I&#8217;m <em>very</em> glad you&#8217;ll not include Singletons—I&#8217;ve made my views on the Singleton quite clear.</p>
<p>Our blog welcomes ideas and discourse; so do it any way you see fit, and we&#8217;ll show it off.</p>
<p>Take care,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: archont</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3304</link>
		<dc:creator>archont</dc:creator>
		<pubDate>Tue, 10 Nov 2009 02:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3304</guid>
		<description>You&#039;re right, pureMVC isn&#039;t pure MVC. It&#039;s actually more than just MVC, my mistake. Then again, I blame it on the &quot;pure&quot; being misleading, so there! ;)

I just might redo your example, although I&#039;ll have to try hard not to reimplement a micro-sized puremvc in it - old habits die hard. While there won&#039;t be any singletons, the view will be composed of components (to avoid using puremvc&#039;s phrase &quot;mediators&quot;) and all information will be passed using flash&#039;s events. I&#039;ll try to do a classic controller instead of commands, but I&#039;ll have to think for a while on how to display the controller&#039;s functionality in a simple yet useful way. 

Then again loose coupling, while a great idea, isn&#039;t exactly in the formal description of what MVC is, and while doing the example I fing the most important thing is to show the core of the idea and when it can come in useful, and where it should be avoided. I could tighten the coupling somewhat by using interfaces, while still being able to swap components ad hoc.

Which do you think would be better?</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, pureMVC isn&#8217;t pure MVC. It&#8217;s actually more than just MVC, my mistake. Then again, I blame it on the &#8220;pure&#8221; being misleading, so there! ;)</p>
<p>I just might redo your example, although I&#8217;ll have to try hard not to reimplement a micro-sized puremvc in it &#8211; old habits die hard. While there won&#8217;t be any singletons, the view will be composed of components (to avoid using puremvc&#8217;s phrase &#8220;mediators&#8221;) and all information will be passed using flash&#8217;s events. I&#8217;ll try to do a classic controller instead of commands, but I&#8217;ll have to think for a while on how to display the controller&#8217;s functionality in a simple yet useful way. </p>
<p>Then again loose coupling, while a great idea, isn&#8217;t exactly in the formal description of what MVC is, and while doing the example I fing the most important thing is to show the core of the idea and when it can come in useful, and where it should be avoided. I could tighten the coupling somewhat by using interfaces, while still being able to swap components ad hoc.</p>
<p>Which do you think would be better?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3303</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Mon, 09 Nov 2009 23:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3303</guid>
		<description>Hi archont,

I guess you wanted a different ending to the truck through MVC... First of all, thanks for expressing yourself so clearly. Second, I think you missed the point I was making about MVC. While to some (yourself perhaps), the MVC is a generalized framework, to me it is nothing more than a vehicle for looking at design patterns. My focus was on looking at the interaction between the Model, View and Controller; not to provide a prototype for using it beyond what I believe its primary purpose is in the Gang of Four&#039;s book. The Model is a data source with input from a UI. As you suggest, using the Model with business logic—especially the kind you provide as a requirement—is certainly better than what I had. (In fact I really like your idea!) The View is for setting objects on the stage, and the Controller for handling user interaction. Those three elements can be used for a myriad of tasks.

However, that&#039;s not what I was trying to do. I was showing the interaction between the objects in the MVC. That, I believe, is what Gamma, Helm, Johnson, and Vlissides were doing as well. The example was short and focused on those elements.

What you and others have done with the MVC is beyond the purpose to help understand the idea of patterns. As GoF say, the purpose of the MVC in their book is
&lt;blockquote&gt;...looking at the design patterns inside MVC should help you see what we mean by the term “pattern.”&lt;/blockquote&gt;

The pureMVC is clearly way beyond the MVC, and Chandima has made that very clear in his posts on the subject. So, I&#039;m not about to attempt to improve on the MVC or pureMVC. That was never my intention, and I said so.

What I invite you to do is to take the compass example and fix it as  an MVC (not a pureMVC) to demonstrate how it would better show the interaction between classes. We&#039;d be glad to post it.

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi archont,</p>
<p>I guess you wanted a different ending to the truck through MVC&#8230; First of all, thanks for expressing yourself so clearly. Second, I think you missed the point I was making about MVC. While to some (yourself perhaps), the MVC is a generalized framework, to me it is nothing more than a vehicle for looking at design patterns. My focus was on looking at the interaction between the Model, View and Controller; not to provide a prototype for using it beyond what I believe its primary purpose is in the Gang of Four&#8217;s book. The Model is a data source with input from a UI. As you suggest, using the Model with business logic—especially the kind you provide as a requirement—is certainly better than what I had. (In fact I really like your idea!) The View is for setting objects on the stage, and the Controller for handling user interaction. Those three elements can be used for a myriad of tasks.</p>
<p>However, that&#8217;s not what I was trying to do. I was showing the interaction between the objects in the MVC. That, I believe, is what Gamma, Helm, Johnson, and Vlissides were doing as well. The example was short and focused on those elements.</p>
<p>What you and others have done with the MVC is beyond the purpose to help understand the idea of patterns. As GoF say, the purpose of the MVC in their book is</p>
<blockquote><p>&#8230;looking at the design patterns inside MVC should help you see what we mean by the term “pattern.”</p></blockquote>
<p>The pureMVC is clearly way beyond the MVC, and Chandima has made that very clear in his posts on the subject. So, I&#8217;m not about to attempt to improve on the MVC or pureMVC. That was never my intention, and I said so.</p>
<p>What I invite you to do is to take the compass example and fix it as  an MVC (not a pureMVC) to demonstrate how it would better show the interaction between classes. We&#8217;d be glad to post it.</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: archont</title>
		<link>http://www.as3dp.com/2009/11/03/truckin%e2%80%99-through-actionscript-30-mvc-part-v%e2%80%94purpose-and-use/comment-page-1/#comment-3302</link>
		<dc:creator>archont</dc:creator>
		<pubDate>Mon, 09 Nov 2009 15:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=2024#comment-3302</guid>
		<description>I believe the example you presented in part 4 is possibly the worst example I could think of. 

It&#039;s not a very big example, but it&#039;s big enough to have a gaping error.

The views. 

The whole point of MVC is to prevent you from rewriting code and using copy&amp;paste. Why on earth would you want to duplicate the slider code? The slider code should be, by all means, a separate view component. 

Second is the proxy, or model issue. The model is there to do business logic. In this example we have no business logic, and so no need for a model. One very important thing in programming is to know when NOT to make something pretty, well-coded and extendable. You need to have realistic expectations and expose, in code, only the things that need to be exposed. 

This example would be teaching people bad habits, meaning that an enclosed piece of data that interacts with only one view component should be externalized (that is, instead of being declared as a private var in the mediator, it should have it&#039;s own mediator) - so someone would, for example, create a separate proxy to handle the position of a visual decorative element that moves to the position of the last menu item you hovered your mouse upon (not clicked, not selected, just hovered). Baseline rule: do a model for the data if it&#039;s going to be accessed by more than one MVC component. Unless you want to get yourself fired.

And I can&#039;t see that kind of requirement here. How could that be fixed? Add some business logic, like calculating the degrees based on declination and position. Then there would be a real need for a proxy, as that kind of code doesn&#039;t belong in a mediator. Then separate the view components into a slider and compass. 

And while I&#039;m at it, loose coupling. Even though MVC at it&#039;s core is about separating the components and making it as free of dependencies as possible, that&#039;s not the case here. 

Next time try demonstrating all this using pureMVC. It&#039;s a strict framework, if a bit uptight. Or robotlegs, which is kind of like pureMVC made right and made to get things done.</description>
		<content:encoded><![CDATA[<p>I believe the example you presented in part 4 is possibly the worst example I could think of. </p>
<p>It&#8217;s not a very big example, but it&#8217;s big enough to have a gaping error.</p>
<p>The views. </p>
<p>The whole point of MVC is to prevent you from rewriting code and using copy&amp;paste. Why on earth would you want to duplicate the slider code? The slider code should be, by all means, a separate view component. </p>
<p>Second is the proxy, or model issue. The model is there to do business logic. In this example we have no business logic, and so no need for a model. One very important thing in programming is to know when NOT to make something pretty, well-coded and extendable. You need to have realistic expectations and expose, in code, only the things that need to be exposed. </p>
<p>This example would be teaching people bad habits, meaning that an enclosed piece of data that interacts with only one view component should be externalized (that is, instead of being declared as a private var in the mediator, it should have it&#8217;s own mediator) &#8211; so someone would, for example, create a separate proxy to handle the position of a visual decorative element that moves to the position of the last menu item you hovered your mouse upon (not clicked, not selected, just hovered). Baseline rule: do a model for the data if it&#8217;s going to be accessed by more than one MVC component. Unless you want to get yourself fired.</p>
<p>And I can&#8217;t see that kind of requirement here. How could that be fixed? Add some business logic, like calculating the degrees based on declination and position. Then there would be a real need for a proxy, as that kind of code doesn&#8217;t belong in a mediator. Then separate the view components into a slider and compass. </p>
<p>And while I&#8217;m at it, loose coupling. Even though MVC at it&#8217;s core is about separating the components and making it as free of dependencies as possible, that&#8217;s not the case here. </p>
<p>Next time try demonstrating all this using pureMVC. It&#8217;s a strict framework, if a bit uptight. Or robotlegs, which is kind of like pureMVC made right and made to get things done.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
