<?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&#8217; Through ActionScript 3.0 MVC: Part III—An Analog Compass</title>
	<atom:link href="http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/</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: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3777</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Wed, 06 Jan 2010 19:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3777</guid>
		<description>Hi Kerry,

Still assuming that Client is &lt;em&gt;the&lt;/em&gt; request class, it is &lt;em&gt;not composed of the other classes; it makes requests from them&lt;/em&gt;. The difficulty for me is that the MVC does not show any particular relationship to a Client class in a class diagram outside of those that are made by developers. In Figure 2 above, my Client used MVC objects, but that is not part of a design pattern. Rather, it&#039;s how I decided to use the MVC for that particular application. Now, compare that with say the Proxy pattern. The Proxy shows where the Client is implied and the relationship it holds with the Subject participant.

If I&#039;m not mistaken, you want to use the Client to attend to several different chores that you do not see as belonging to the M, V or C. In this particular case, I believe that the View would be in charge of setting up listeners; so no, that would not be the job of the Client.

The best summary of the jobs of the MVC is the one Chandima did on page 429. Everything is broken down for you. Take a look at it, and let me know if that helps more than I did (or failed to do!).

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>Still assuming that Client is <em>the</em> request class, it is <em>not composed of the other classes; it makes requests from them</em>. The difficulty for me is that the MVC does not show any particular relationship to a Client class in a class diagram outside of those that are made by developers. In Figure 2 above, my Client used MVC objects, but that is not part of a design pattern. Rather, it&#8217;s how I decided to use the MVC for that particular application. Now, compare that with say the Proxy pattern. The Proxy shows where the Client is implied and the relationship it holds with the Subject participant.</p>
<p>If I&#8217;m not mistaken, you want to use the Client to attend to several different chores that you do not see as belonging to the M, V or C. In this particular case, I believe that the View would be in charge of setting up listeners; so no, that would not be the job of the Client.</p>
<p>The best summary of the jobs of the MVC is the one Chandima did on page 429. Everything is broken down for you. Take a look at it, and let me know if that helps more than I did (or failed to do!).</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3774</link>
		<dc:creator>Kerry</dc:creator>
		<pubDate>Wed, 06 Jan 2010 17:44:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3774</guid>
		<description>Thanks for the quick response Bill.

I think if I give you a better example it&#039;d be easier for you to answer me. 

Say I have an class, let&#039;s call it Client, that is being composed of 3 other &#039;objects&#039;, each of which is broken down into it&#039;s own MVC triad. So would the Client class have 9 classes in total, i.e. object1Model, object1View, object1Controller, etc.?? 

On top of that, say when object1&#039;s model gets updated and it has to affect object2&#039;s view and model. I&#039;m almost positive the Client class would be in charge of setting up the listeners as object1 would have no knowledge of object2 and vice versa.

Hopefully that makes things less broad.

Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks for the quick response Bill.</p>
<p>I think if I give you a better example it&#8217;d be easier for you to answer me. </p>
<p>Say I have an class, let&#8217;s call it Client, that is being composed of 3 other &#8216;objects&#8217;, each of which is broken down into it&#8217;s own MVC triad. So would the Client class have 9 classes in total, i.e. object1Model, object1View, object1Controller, etc.?? </p>
<p>On top of that, say when object1&#8217;s model gets updated and it has to affect object2&#8217;s view and model. I&#8217;m almost positive the Client class would be in charge of setting up the listeners as object1 would have no knowledge of object2 and vice versa.</p>
<p>Hopefully that makes things less broad.</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3773</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Wed, 06 Jan 2010 17:12:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3773</guid>
		<description>Hi Kerry,

For me, the Client class is &lt;em&gt;always&lt;/em&gt; the class that makes requests. Sometimes the Client is part of the design pattern (shown in the class diagram), sometimes it is implied (shown in the class diagram as &#039;ghosted&#039; in gray), and sometimes you don&#039;t see it at all in the diagram.

Strictly speaking, the MVC is not part of the original set of design patterns. Rather, I see it as a heuristic device to help understand design patterns. However, since the publication of the Gang of Four&#039;s book, it seems to have taken on a life of its own and developers use it for different things. (Chandima is the real MVC expert.)

Most programmers seem to use the name &lt;strong&gt;Main&lt;/strong&gt; for their Client class—I have as well on occasion. So if you look at some MVCs, dig up &lt;strong&gt;Main.as&lt;/strong&gt; and you&#039;ll probably be seeing what GoF reference as the &lt;strong&gt;Client&lt;/strong&gt;. You can see a good example of this with the MVC on page 436 of our book.

Let me know if this explains what you need.

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Kerry,</p>
<p>For me, the Client class is <em>always</em> the class that makes requests. Sometimes the Client is part of the design pattern (shown in the class diagram), sometimes it is implied (shown in the class diagram as &#8216;ghosted&#8217; in gray), and sometimes you don&#8217;t see it at all in the diagram.</p>
<p>Strictly speaking, the MVC is not part of the original set of design patterns. Rather, I see it as a heuristic device to help understand design patterns. However, since the publication of the Gang of Four&#8217;s book, it seems to have taken on a life of its own and developers use it for different things. (Chandima is the real MVC expert.)</p>
<p>Most programmers seem to use the name <strong>Main</strong> for their Client class—I have as well on occasion. So if you look at some MVCs, dig up <strong>Main.as</strong> and you&#8217;ll probably be seeing what GoF reference as the <strong>Client</strong>. You can see a good example of this with the MVC on page 436 of our book.</p>
<p>Let me know if this explains what you need.</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kerry</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3772</link>
		<dc:creator>Kerry</dc:creator>
		<pubDate>Wed, 06 Jan 2010 16:23:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3772</guid>
		<description>Can you please explain the Client in more detail? And can the client be composed of more than MVC? Could the client ever be part of it&#039;s own MVC triad and even if it could, would it make sense to do that? Or is the client just a class that utilizes other MVCs?

Thanks!</description>
		<content:encoded><![CDATA[<p>Can you please explain the Client in more detail? And can the client be composed of more than MVC? Could the client ever be part of it&#8217;s own MVC triad and even if it could, would it make sense to do that? Or is the client just a class that utilizes other MVCs?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3380</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Tue, 17 Nov 2009 22:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3380</guid>
		<description>Hi Wolle,

I see what you mean. Take a look at the Mouse properties and see if you can slip in a value in one of its properties from the TextField--using one of the Focus events to pass it to the button and then on to an event handler in the Controller.

I&#039;m pretty sure you can do it, but it will take can artful dodging and might be a little hacky. It sounds like a fun little project, though. If I have time, it&#039;s something that I&#039;ll play around with, but don&#039;t let me have all the fun!

Take care,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Wolle,</p>
<p>I see what you mean. Take a look at the Mouse properties and see if you can slip in a value in one of its properties from the TextField&#8211;using one of the Focus events to pass it to the button and then on to an event handler in the Controller.</p>
<p>I&#8217;m pretty sure you can do it, but it will take can artful dodging and might be a little hacky. It sounds like a fun little project, though. If I have time, it&#8217;s something that I&#8217;ll play around with, but don&#8217;t let me have all the fun!</p>
<p>Take care,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolle</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3378</link>
		<dc:creator>Wolle</dc:creator>
		<pubDate>Tue, 17 Nov 2009 21:49:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3378</guid>
		<description>But it is not possible to get myText.text when you are in the controller.
Otherwise, if the function newDirection is of the view, you manipulate the model directly from the view, so the controller doesn&#039;t make any sense to me.
Sorry if I mix up something cause I’m very new to MVC and perhaps didn’t really get it.</description>
		<content:encoded><![CDATA[<p>But it is not possible to get myText.text when you are in the controller.<br />
Otherwise, if the function newDirection is of the view, you manipulate the model directly from the view, so the controller doesn&#8217;t make any sense to me.<br />
Sorry if I mix up something cause I’m very new to MVC and perhaps didn’t really get it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3377</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Tue, 17 Nov 2009 20:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3377</guid>
		<description>Hi Wolle,

A text field would work fine using a button and MouseEvent. Just change the event handler function (newDirection) to the following:
&lt;pre lang=&quot;actionscript&quot;&gt;
public function newDirection(e:MouseEvent):void
{
      var dirNow:Number=Number(myText.text);
      model.setDir(dirNow);
}
&lt;/pre&gt;

It&#039;s just data and how it gets to the compass shouldn&#039;t matter.

Kindest regards,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Wolle,</p>
<p>A text field would work fine using a button and MouseEvent. Just change the event handler function (newDirection) to the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1954code1'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p19541"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1954code1"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> newDirection<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">var</span> dirNow:<span style="color: #0066CC;">Number</span>=<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>myText.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>;
      model.<span style="color: #006600;">setDir</span><span style="color: #66cc66;">&#40;</span>dirNow<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>It&#8217;s just data and how it gets to the compass shouldn&#8217;t matter.</p>
<p>Kindest regards,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolle</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3376</link>
		<dc:creator>Wolle</dc:creator>
		<pubDate>Tue, 17 Nov 2009 20:31:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3376</guid>
		<description>Hi Bill,
thank you for this Tutorial! Good introduction to MVC.
But I have one question: What if I don’t use a Slider, but a TextField and a Button, to change a value of the model? Then I can’t get the value through the event’s target, can I ?

Best
W.</description>
		<content:encoded><![CDATA[<p>Hi Bill,<br />
thank you for this Tutorial! Good introduction to MVC.<br />
But I have one question: What if I don’t use a Slider, but a TextField and a Button, to change a value of the model? Then I can’t get the value through the event’s target, can I ?</p>
<p>Best<br />
W.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William B. Sanders</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3269</link>
		<dc:creator>William B. Sanders</dc:creator>
		<pubDate>Mon, 02 Nov 2009 12:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3269</guid>
		<description>Hi Yarden,

I&#039;d be very interested in hearing what you have to say about the MVC (and other Design Patterns) from the PHP perspective. I&#039;ve worked with PHP for years, and I really like the language, and Chandima and I have begun some work on DPs and PHP.

What would you say is the main difference between the MVC in PHP and ActionScript 3.0? Take a look at Part IV of this MVC series and see if that increases or reduces the difference between PHP and ActionScript 3.0 use of MVC.

Thanks and hope to hear from you more,
Bill</description>
		<content:encoded><![CDATA[<p>Hi Yarden,</p>
<p>I&#8217;d be very interested in hearing what you have to say about the MVC (and other Design Patterns) from the PHP perspective. I&#8217;ve worked with PHP for years, and I really like the language, and Chandima and I have begun some work on DPs and PHP.</p>
<p>What would you say is the main difference between the MVC in PHP and ActionScript 3.0? Take a look at Part IV of this MVC series and see if that increases or reduces the difference between PHP and ActionScript 3.0 use of MVC.</p>
<p>Thanks and hope to hear from you more,<br />
Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yarden Refaeli</title>
		<link>http://www.as3dp.com/2009/10/31/truckin-through-actionscript-30-mvc-part-iii%e2%80%94an-analog-compass/comment-page-1/#comment-3268</link>
		<dc:creator>Yarden Refaeli</dc:creator>
		<pubDate>Mon, 02 Nov 2009 11:42:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.as3dp.com/?p=1954#comment-3268</guid>
		<description>Thank you, very helpful post!
I know the MVC from the PHP prespective, which is pretty different ;)</description>
		<content:encoded><![CDATA[<p>Thank you, very helpful post!<br />
I know the MVC from the PHP prespective, which is pretty different ;)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
