<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Building Blocks</title>
	<atom:link href="http://joelhooks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://joelhooks.com</link>
	<description>It's a magical world. Let's go exploring.</description>
	<lastBuildDate>Tue, 29 Jun 2010 18:45:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
		<item>
		<title>More than a few reasons to go to FiTC San Francisco</title>
		<link>http://joelhooks.com/2010/06/29/more-than-a-few-reasons-to-go-to-fitc-san-francisco/</link>
		<comments>http://joelhooks.com/2010/06/29/more-than-a-few-reasons-to-go-to-fitc-san-francisco/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 18:45:06 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[conference]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=558</guid>
		<description><![CDATA[I'm extremely excited about FiTC San Francisco. These guys know how to put on a show. What a line-up. Yugo Nakamura, Kevin Lynch, Mario Klingemann, Ralph Hauwert, Grant Skinner... The list is huge, and filled with top notch presenters. I'm a bit sad, as I am presenting at the same time as Keith Peters. His [...]]]></description>
			<content:encoded><![CDATA[<p>I'm extremely excited about FiTC San Francisco. These guys know how to put on a show. </p>
<p>What a line-up. Yugo Nakamura, Kevin Lynch, Mario Klingemann, Ralph Hauwert, Grant Skinner... <a href="http://www.fitc.ca/events/speakers/?event=110">The list is huge</a>, and filled with top notch presenters. I'm a bit sad, as I am presenting at the same time as Keith Peters. His "<a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=110&#038;presentation_id=1207">Programming Art</a>" talk sounds awesome. It is going to be three full days jam-packed with awesome.</p>
<p>I'm going to be giving a <a href="http://www.fitc.ca/events/presentations/presentation.cfm?event=110&#038;presentation_id=1238">talk on Robotlegs</a> at the event.</p>
<p>There is still time to get the early bird tickets, and FiTC is offering a 10% discount if you use the code "joelhooks" - really hope to see you there.</p>
<div align = "center"><a href="http://www.fitc.ca/events/about/?event=110"><img src="http://www.fitc.ca/events/extras/sanfran/banners/FITC_sf2010_710x150.jpg" alt="" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/06/29/more-than-a-few-reasons-to-go-to-fitc-san-francisco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Do we really need THAT much metadata in AS3? Not with Robotlegs&#8230;</title>
		<link>http://joelhooks.com/2010/06/16/do-you-need-metadata-as3-robotlegs/</link>
		<comments>http://joelhooks.com/2010/06/16/do-you-need-metadata-as3-robotlegs/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 14:13:23 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[design patterns]]></category>
		<category><![CDATA[dev tools]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[software architecture]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=527</guid>
		<description><![CDATA[There was a time in the push for a Robotlegs 1.0 that a nometa implementation existed. Robert Penner still uses it, if I'm not mistaken. It doesn't have as much convenience as the regular meta-loving MVCS implementation, meaning it doesn't inject a bunch of classes into the MVCS base classes. Is that bad? Not really. [...]]]></description>
			<content:encoded><![CDATA[<p>There was a time in the push for a Robotlegs 1.0 that a nometa implementation existed. <a href="http://github.com/robertpenner">Robert Penner</a> still uses it, if I'm not mistaken. It doesn't have as much convenience as the regular meta-loving MVCS implementation, meaning it doesn't inject a bunch of classes into the MVCS base classes. Is that bad? Not really. I find myself rarely using the injected classes anyway. At the time I pushed back on the nometa implementation and its inclusion in the core. I still think that is proper, because it would just tend to cloud the implementation and make it more difficult to document and support, both of these being key pillars in making Robotlegs a successful project that people will actually use. The concept of using as little metadata as possible in my applications is very appealing.</p>
<div align="center"><a href="http://xkcd.com/754/"><img src="http://imgs.xkcd.com/comics/dependencies.png" alt="" /></a></div>
<p><span id="more-527"></span><br />
<a href="http://github.com/tschneidereit/SwiftSuspenders#readme">SwiftSuspenders</a> beautifully supports constructor injection. This means that you don't need to annotate any methods or the class with metadata for it to honor injection into the constructor. With the [Inject] tag, you are marking required dependencies. They aren't optional. If there is no rule to supply the injection you will get a runtime error saying as such. So, given these non-optional dependencies, injecting them into the constructor makes a lot of sense. One drawback to this approach is that if you are injecting a lot of dependencies your constructor might get really big. In fact, the limit is 10 parameters. Guess what? If your class requires that many dependencies, it already smells bad. Clean it up and think <a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod">single responsibility</a>. For the love of Uncle Bob, keep it clean.</p>
<p>To illustrate this point I have refactored the Image Gallery example. It was my first example for Robotlegs almost a year ago. The original version resides in the Robotlegs Demo Bundle. In this refactoring I removed all occurrences of the [Inject] metadata tag. In addition, I removed all of the extensions of Robotlegs mvcs implementation sub-classes with the exception of Mediator. There are no Actor or Command subclasses. So what you end up with is a Command, Model, and Service tier that is completely meta and framework free. That rocks. It is just AS3 code doing its job. I love that.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_RobotlegsFlickrGallery_57455830"
			class="flashmovie"
			width="700"
			height="700">
	<param name="movie" value="http://joelhooks.com/examples/galleryNoMeta/RobotlegsFlickrGallery.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joelhooks.com/examples/galleryNoMeta/RobotlegsFlickrGallery.swf"
			name="fm_RobotlegsFlickrGallery_57455830"
			width="700"
			height="700">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><a href="http://github.com/joelhooks/robotlegs-examples-FlickrGalleryNoMeta">Here's a link to the source for this project on Github</a>.</p>
<p>Tooling is very lacking for metadata in all of the IDEs currently available. The <a href="http://www.elementriver.com/sourcemate/">SourceMate</a> plugin from ElementRiver is a nice addition to Flash Builder if you make use of metadata. It actually gives you code completion, which in and of itself is a huge improvement over... nothing. I hope to see more IDE support for metadata soon. It would really make it a lot easier to manage.</p>
<p>In my professional life, I use all of the Actionscript DI frameworks (<a href="http://www.robotlegs.org/">Robotlegs</a>, <a href="http://swizframework.org/">Swiz</a>, and <a href="http://www.spicefactory.org/parsley/">Parsley</a>). They are all great, when used appropriately within a defined set of patterns and practices. I worry about the trend for increased use of metadata. I think the complexity overhead is large. Sure, <strong>you</strong> get it, but there is a responsibility to build systems that can be understood by a wide range of developers without weeks of remedial training on a complex metadata based <a href="http://en.wikipedia.org/wiki/Domain-specific_language">DSL</a>. The less complex we make our complex systems the better. They are easier to train for, document, and build.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/06/16/do-you-need-metadata-as3-robotlegs/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Slides from Flash and the City Presentation on Robotlegs AS3</title>
		<link>http://joelhooks.com/2010/05/18/slides-from-flash-and-the-city-presentation-on-robotlegs-as3/</link>
		<comments>http://joelhooks.com/2010/05/18/slides-from-flash-and-the-city-presentation-on-robotlegs-as3/#comments</comments>
		<pubDate>Wed, 19 May 2010 01:19:52 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[robotlegs]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=510</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div align="center">
<div style="width:425px" id="__ss_4145254"><object id="__sse4145254" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fatc2010-100518193313-phpapp01&#038;stripped_title=fatc-2010" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4145254" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=fatc2010-100518193313-phpapp01&#038;stripped_title=fatc-2010" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/05/18/slides-from-flash-and-the-city-presentation-on-robotlegs-as3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Modular Robotlegs</title>
		<link>http://joelhooks.com/2010/05/02/modular-robotlegs/</link>
		<comments>http://joelhooks.com/2010/05/02/modular-robotlegs/#comments</comments>
		<pubDate>Mon, 03 May 2010 04:08:50 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[software architecture]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=477</guid>
		<description><![CDATA[WTF is a Modular? Modular programming is a versatile technique for separating an application into smaller parts. Each module is effectively an application and can be developed independently from one another. In a typical modular application you will have a Shell that is loaded initially. The Shell will manage the loading of modules and displaying [...]]]></description>
			<content:encoded><![CDATA[<h2>WTF is a Modular?</h2>
<p>Modular programming is a versatile technique for separating an application into smaller parts. Each module is effectively an application and can be developed independently from one another. In a typical modular application you will have a Shell that is loaded initially. The Shell will manage the loading of modules and displaying their contents. Flex modules can be visual components that extend the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/modules/Module.html">Module</a> class, but this is certainly not the extent of what can be considered a module.<br />
<img src="http://69.164.207.135/wp-content/uploads/2010/05/ModularUtility4.png" alt="" title="ModularUtility" width="472" height="249" class="aligncenter size-full wp-image-502" /><br />
Robotlegs is well suited for modular application development. Each Context is encapsulated and provides its own internal method for communication. A barrier to writing modular applications thus far with Robotlegs is that while these Context objects can exist in abundance in an application, they aren't very useful from a modular standpoint unless they can communicate with one another. As with many things within the Robotlegs eco-system, this is best accomplished through the development of a utility that can be used in conjunction with the core framework to provide the specific functionality that we are looking for. There has been some good work done in this area, but with Robotlegs 1.1 and more specifically the 1.5 release of the default Dependency Injection provider SwiftSuspenders, we have been equipped with better tools to accomplish modular contexts in a Robotlegs application in a clean effective manner.<br />
<span id="more-503"></span></p>
<h2>A Little Backstory</h2>
<p>Prior to Robotlegs I used <a href="http://puremvc.org">PureMVC</a> exclusively. There is a utility for PureMVC called <a href="http://trac.puremvc.org/Utility_AS3_MultiCore_Pipes">Pipes</a>, which I have <a href="http://joelhooks.com/2009/05/18/piping-the-machine-puremvc-multicore-with-pipes-and-the-finite-state-machine-fsm/">written about previously</a>. Pipes is pretty cool. It uses a plumbing metaphor to describe the connections between modules. It is... verbose... and requires a shit-ton of wiring code to be functional. This can be a challenge to get your head around, and can create code that you have to stare at for a good while to fully understand HTF everything is actually being wired.</p>
<p>My original path for a Robotlegs modular utility was to port Pipes. In fact, I didn't really have to port Pipes, but just wrote an adapter that allowed Pipes to fit into a Robotlegs application. The problem was that it didn't feel like Robotlegs. Verbose and confusing goes against the core moral fiber of what Robotlegs is all about. So I started whittling it down. At that point it looked like <a href="http://github.com/Stray/robotlegs-utilities-Modular">Stray's excellent work with the Robotlegs Modular utility</a>. Heh. Full Circle! So instead of using Pipes, I've taken her work and expanded on it for Robotlegs 1.1 and at the same time clarifying some of the concepts within the utility and making it more useful across a broader range of use cases.</p>
<h2>Where we are now</h2>
<p>So with Pipes set aside for now, we have a dead simple modular implementation that can be used for Flex, AS3, and maybe even Flash applications. It doesn't provide all of the functionality that Pipes brings to the table. Specifically it is missing concepts like message filtering and queuing. While these are likely useful tools, I didn't feel that they needed to be implemented just yet. I have some ideas about how they might be implemented, but feel that the Robotlegs Modular Utility is clean and simple covering a big majority of typical use cases. Start simple and expand from there. This is where I am relying on you, gentle reader, to help guide the utility into something more useful while still keeping the clean and simple Robotlegs aesthetic.</p>
<p>With that behind us, lets look at an example of a modular application written with the <a href="http://github.com/joelhooks/robotlegs-utilities-Modular">Robotlegs Modular Utility</a>. It is fairly useless, but covers the core concepts of what a modular application should be able to do.</p>
<h2>Modular Doodads: A Lame but Functional Example</h2>
<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_ModularDoodads_951417091"
			class="flashmovie"
			width="450"
			height="550">
	<param name="movie" value="http://joelhooks.com/examples/modularDoodads/ModularDoodads.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joelhooks.com/examples/modularDoodads/ModularDoodads.swf"
			name="fm_ModularDoodads_951417091"
			width="450"
			height="550">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></div>
<p><strong><a href="http://github.com/joelhooks/robotlegs-examples-ModularDoodads">The full source for this example can be found HERE...</a></strong></p>
<div class="note-block">It was noted in the comments that this gets sluggish after more than a few Doodads are added. This is a Flex invalidation issue. <a href="http://joelhooks.com/examples/modularDoodadsAS3/ModularDoodads.html">Here is the example in pure AS3 with MinimalComps (view source is enabled)</a></div>
<p>In this example you have three separate modules: the Shell, or the main application, a logging module that provides "console" output, and Doodads. Doodads are simple modules with not a whole lot of functionality. When you add a Doodad the shell creates a new Doodad and adds it to a container. The Doodads have a "request" button that will ask any other Doodads to change color. In addition to that, they have a close button to remove the Doodad. Above the Doodad container is a "trigger" button. This sends out an event that triggers a command on all of the Doodad modules (causing them to flash violently).</p>
<h3>ModularDoodadsContext.as</h3>

<div class="wp_codebox"><table><tr id="p5034"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p503code4"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ModularDoodadsContext <span style="color: #0066CC;">extends</span> ModuleContext
<span style="color: #66cc66;">&#123;</span>
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> startup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #808080; font-style: italic;">//map the modules so that instances will be properly supplied (injected) with an injector.</span>
        viewMap.<span style="color: #006600;">mapType</span><span style="color: #66cc66;">&#40;</span>LoggerModule<span style="color: #66cc66;">&#41;</span>;
        viewMap.<span style="color: #006600;">mapType</span><span style="color: #66cc66;">&#40;</span>DoodadModule<span style="color: #66cc66;">&#41;</span>;
&nbsp;
        mediatorMap.<span style="color: #006600;">mapView</span><span style="color: #66cc66;">&#40;</span>ModularDoodads, ModuleDoodadsMediator<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The main shell application context context is doing a couple of things. As with the other modules within the application, this Context extends ModuleContext. ModuleContext will create the ModuleEventDispatcher (IModuleEventDispatcher) as well as a ModuleCommandMap that can be used to map commands that respond to events on the ModuleEventDispatcher. ModuleContext is a convenience mechanism.</p>
<p>Since the modules in this application are view components we can use the ViewMap to map their types. This facilitates injection into the modules when they are added to the stage. The reason for this will become clear as we look at one of these modules.</p>
<h3>LoggerModule.mxml</h3>

<div class="wp_codebox"><table><tr id="p5035"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code" id="p503code5"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Module xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
           xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
           xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/mx&quot;</span>
           <span style="color: #0066CC;">implements</span>=<span style="color: #ff0000;">&quot;org.robotlegs.utilities.modular.core.IModule&quot;</span>
           layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;75&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>fx:Script<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
            <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">robotlegs</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">IContext</span>;
            <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">robotlegs</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">IInjector</span>;
            <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">robotlegs</span>.<span style="color: #006600;">utilities</span>.<span style="color: #006600;">modular</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">IModule</span>;
            <span style="color: #0066CC;">import</span> org.<span style="color: #006600;">robotlegs</span>.<span style="color: #006600;">utilities</span>.<span style="color: #006600;">modular</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">IModuleContext</span>;
&nbsp;
            <span style="color: #0066CC;">import</span> robotlegs.<span style="color: #006600;">examples</span>.<span style="color: #006600;">modulardoodads</span>.<span style="color: #006600;">modules</span>.<span style="color: #006600;">logger</span>.<span style="color: #006600;">skins</span>.<span style="color: #006600;">LoggingTextArea</span>;
&nbsp;
            protected <span style="color: #000000; font-weight: bold;">var</span> context:IModuleContext;
&nbsp;
            <span style="color: #66cc66;">&#91;</span>Embed<span style="color: #66cc66;">&#40;</span>mimeType=<span style="color: #ff0000;">'application/x-font'</span>, source=<span style="color: #ff0000;">&quot;assets/AnonPro.ttf&quot;</span>, fontName=<span style="color: #ff0000;">&quot;Anon&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> anon:<span style="color: #000000; font-weight: bold;">Class</span>;
&nbsp;
            <span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
            <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> messages:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
            <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addLoggingMessage<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">message</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                <span style="color: #0066CC;">message</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span>;
                messages += <span style="color: #0066CC;">message</span>;
                scrollToMax<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> scrollToMax<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                messageDisplay.<span style="color: #006600;">validateNow</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                messageDisplay.<span style="color: #006600;">scroller</span>.<span style="color: #006600;">verticalScrollBar</span>.<span style="color: #006600;">value</span> = messageDisplay.<span style="color: #006600;">scroller</span>.<span style="color: #006600;">verticalScrollBar</span>.<span style="color: #006600;">maximum</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #808080; font-style: italic;">/**
             * We need to initialize our context by setting the parent
             * injector for the module. This is actually injected by the
             * shell, so no need to worry about it!
            */</span>
            <span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
            <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> parentInjector<span style="color: #66cc66;">&#40;</span>value:IInjector<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                context = <span style="color: #000000; font-weight: bold;">new</span> LoggerModuleContext<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, value<span style="color: #66cc66;">&#41;</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
            <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> dispose<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
            <span style="color: #66cc66;">&#123;</span>
                context.<span style="color: #006600;">dispose</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                context = <span style="color: #000000; font-weight: bold;">null</span>;
            <span style="color: #66cc66;">&#125;</span>
&nbsp;
        <span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>fx:Script<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
        <span style="color: #66cc66;">&lt;!</span>-- Place non-visual elements <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">g</span>., services, value objects<span style="color: #66cc66;">&#41;</span> here --<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;/</span>fx:Declarations<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>s:TextArea
        id=<span style="color: #ff0000;">&quot;messageDisplay&quot;</span>
        fontFamily=<span style="color: #ff0000;">&quot;Anon&quot;</span>
        fontSize=<span style="color: #ff0000;">&quot;12&quot;</span>
        <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
        <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{messages}&quot;</span>
        skinClass=<span style="color: #ff0000;">&quot;robotlegs.examples.modulardoodads.modules.logger.skins.LoggingTextArea&quot;</span><span style="color: #66cc66;">/&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Module<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>Looking at the LoggerModule.mxml it is important to note that it implements the org.robotlegs.utilities.modular.core.IModule interface. This provides a contract to ensure that we supply the appropriate API to initialize the module. The IModule interface provides a setter for the parentInjector as well as a dispose() method that we can use to cleanup the module when it is removed. The key here is the setter for the parentInjector that supplies an injector to the module. This setter actually creates the context or the module and passes the injector into the context. As you will recall in the ModularDoodadContext above, the LoggerModule was mapped with the ViewMap. This means that when it is added to the stage its dependencies are injected. parentInjector is marked with the [Inject] metadata so the injector is automatically provided to the module. The context will then use that injector and create a child injector.</p>
<h5>Child Injectors</h5>
<p>A child injector is a new concept in Robotlegs 1.1. It is a powerful tool. When the parentInjector is set, the module context uses it to create a child injector. This child injector has a reference to its parent and the parent's injection mappings. This means that if you don't create a mapping in the child injector it will supply the injection a mapped within the parent (or grandparent). The parent has no reference at all to the child, and doesn't even know that it exists so if you create mappings in a child injector they are not reflected up the injector chain to ancestors. If you create a mapping that is identical to a mapping within an injector's family tree, the first mapping is honored and the injector will not check with its ancestors to see if the mapping exists.</p>
<p>Through this mechanism of child injectors we are able to map an event dispatcher within the top level application context that can then be shared amongst any number of other contexts providing that they are able to create and use a child injector. This is the core of how these modules are able to communicate with one another. We create the IModuleEventDispatcher in the shell and all sub-modules now have access to it through their injector. As long as you don't map a IModuleEventDispatcher with the child, any injections that call for it will be supplied with the original dispatcher from the parent injector.</p>
<p> Now what? For the most part, you develop modules <a href="http://wiki.github.com/robotlegs/robotlegs-framework/best-practices">as you would any other Robotlegs application</a>. The Modular Utility does provide one other convenient mechanism to help save you on some typing. That is the ModuleMediator.</p>
<h3>DoodadModuleMediator.as</h3>

<div class="wp_codebox"><table><tr id="p5036"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code" id="p503code6"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DoodadModuleMediator <span style="color: #0066CC;">extends</span> ModuleMediator
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
    <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> view:DoodadModule;
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> madeRequest:<span style="color: #0066CC;">Boolean</span>;
&nbsp;
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onRegister<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        addViewListener<span style="color: #66cc66;">&#40;</span>DoodadModuleEvent.<span style="color: #006600;">DO_STUFF_REQUESTED</span>, handleDoStuffRequested, DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>;
        addViewListener<span style="color: #66cc66;">&#40;</span>DoodadModuleEvent.<span style="color: #006600;">REMOVE</span>, handleRemove<span style="color: #66cc66;">&#41;</span>;
        addModuleListener<span style="color: #66cc66;">&#40;</span>DoodadModuleEvent.<span style="color: #006600;">DO_STUFF_REQUESTED</span>, handleDoStuffRequest, DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>;
        addContextListener<span style="color: #66cc66;">&#40;</span>DoodadModuleEvent.<span style="color: #006600;">FLASH_YOUR_DOODAD</span>, handleDoodadFlashRequest<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleRemove<span style="color: #66cc66;">&#40;</span>event:DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        dispatchToModules<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LoggingEvent<span style="color: #66cc66;">&#40;</span>LoggingEvent.<span style="color: #0066CC;">MESSAGE</span>, <span style="color: #ff0000;">&quot;Removing DoodadModule&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        dispatchToModules<span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
        view.<span style="color: #006600;">dispose</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleDoStuffRequested<span style="color: #66cc66;">&#40;</span>event:DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        madeRequest = <span style="color: #000000; font-weight: bold;">true</span>;
        dispatchToModules<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LoggingEvent<span style="color: #66cc66;">&#40;</span>LoggingEvent.<span style="color: #0066CC;">MESSAGE</span>, <span style="color: #ff0000;">&quot;DoodadModule made request...&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        moduleDispatcher.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleDoStuffRequest<span style="color: #66cc66;">&#40;</span>event:DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span>madeRequest<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#123;</span>
            view.<span style="color: #0066CC;">color</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span>0xFFFFFF;
            dispatchToModules<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> LoggingEvent<span style="color: #66cc66;">&#40;</span>LoggingEvent.<span style="color: #0066CC;">MESSAGE</span>, <span style="color: #ff0000;">&quot;DoodadModule changed color: &quot;</span> + view.<span style="color: #0066CC;">color</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
        madeRequest = <span style="color: #000000; font-weight: bold;">false</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> handleDoodadFlashRequest<span style="color: #66cc66;">&#40;</span>event:DoodadModuleEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
        view.<span style="color: #006600;">flashIt</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The DoodadModuleMediator extends ModuleMediator. The ModuleMediator provides basic injections for the ModuleCommandMap and the ModuleEventDispatcher. ModuleMediator also provides some convenience with a bit of syntactic sugar to make it easy to dispatch events to the ModuleEventDispatcher. The dispatchToModules() method sends events over the ModuleEventDispatcher in contrast to the dispatch() method which sends events over the EventDispatcher that is local to the context. Additionally you are provided with addModuleListener() that makes it easy to add a listener for an event type that is expected to be dispatched from another module (including the shell). These methods simply abstract the eventMap.mapListener() method, which in turn is abstracting eventDispatcher.addEventListener(). You have nothing if not options when it comes to adding a listener within a mediator!</p>
<h2>Modular Application Development in Flex... Some Caveats</h2>
<p>Possibly the biggest gotcha with modular application development is managing memory. With a typical application you are dealing with a single "module" - the application itself. You do not typically attempt to unload your entire application from memory. Simply refreshing the page or navigating away more effectively does this. We do try to prevent memory leaks diligently (right?) to provide our users with the smoothest possible experience, but this is different from trying to release all of the memory the application uses at runtime. Modules, on the other hand, can come into existence at runtime at any point during the lifecycle of your application. On the flip side of that is that the modules should be able to completely unload and release all of the memory that they have used.</p>
<p>There are a host of "tricks" to getting modules out of memory. This <a href="http://blogs.adobe.com/tomsugden/2010/02/how_to_unload_modules_effectively.html">article</a> is a good overview of the major ones. In addition to these sneaky memory peggers, you will also want to carefully ensure that your modules release references and dispose of objects properly.</p>
<p>The Modular Utility makes every effort to provide mechanisms for disposing of your modules, but when it gets down to it most of that responsibility will be left up to you. If you notice that Robotlegs or the Modular Utility is preventing a module from unloading <b>please let me know</b> so that I can address it as soon as possible. The end goal is to provide a robust tool for developing Robotlegs applications with modules. The Modular Utility is currently very modest, but what it isn't is a solution looking for a problem. As it grows it will be in response to real problems, and your feedback and use is critical to meeting that goal.</p>
<h3>The bits you'll need...</h3>
<p><a href="http://github.com/joelhooks/robotlegs-utilities-Modular">Robotlegs Modular Utility (my fork)</a><br />
<a href="http://github.com/joelhooks/robotlegs-examples-ModularDoodads">The full source for this example</a><br />
<a href="http://www.robotlegs.org">Robotlegs AS3</a></p>
<h3>On a related note...</h3>
<p>I recently had the pleasure of writing a full 22 pages on Robotlegs in the upcoming <a href="http://www.manning.com/ahmed2/">Flex 4 in Action from Manning</a>. It is a great book overall and if you'd like to learn more about Robotlegs (or Flex 4 in general) then I highly recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/05/02/modular-robotlegs/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>IntelliJ Idea Flex and Actionscript 3 Workflow: [Part 1] Creating a Flex Project</title>
		<link>http://joelhooks.com/2010/03/21/intellij-idea-flex-and-actionscript-3-workflow-part-1-creating-a-flex-project/</link>
		<comments>http://joelhooks.com/2010/03/21/intellij-idea-flex-and-actionscript-3-workflow-part-1-creating-a-flex-project/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 03:08:50 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[dev tools]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=463</guid>
		<description><![CDATA[I've been using IntelliJ Idea 9 quite a bit in both production and personal work lately. It is a great IDE, with lots of useful features. This is going to be a series of short screencasts that highlight the workflow in Idea for Flex/Actionscript development. The first is a quick introduction and how to set [...]]]></description>
			<content:encoded><![CDATA[<p>I've been using IntelliJ Idea 9 quite a bit in both production and personal work lately. It is a great IDE, with lots of useful features. This is going to be a series of short screencasts that highlight the workflow in Idea for Flex/Actionscript development. The first is a quick introduction and how to set up a Flex project. If you have any questions or requests for future videos in the series please feel free to leave them in the comments.</p>
<p><a href="http://joelhooks.com/video/intro.mov" rel="shadowbox;height=664;width=994"><img src="http://69.164.207.135/wp-content/uploads/2010/03/idea_flex_part1.png" alt="" title="idea_flex_part1" width="450" height="301" class="aligncenter size-full wp-image-464" /></a></p>
<p><a href="http://joelhooks.com/video/intro.mov">direct link to the video (42mb QT)</a></p>
<h3>Resources</h3>
<p><a href="http://confluence.jetbrains.net/display/IDEADEV/Maia+EAP">IntelliJ IDEA EAP Download Page</a><br />
<a href="http://www.insideria.com/2010/02/intellij-idea9-actionscript-3f.html">Jesse Freeman's IDEA Workflow series on InsideRIA</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/03/21/intellij-idea-flex-and-actionscript-3-workflow-part-1-creating-a-flex-project/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
<enclosure url="http://joelhooks.com/video/intro.mov" length="44160652" type="video/quicktime" />
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Robotlegs, AS3-Signals and the SignalCommandMap Example</title>
		<link>http://joelhooks.com/2010/02/14/robotlegs-as3-signals-and-the-signalcommandmap-example/</link>
		<comments>http://joelhooks.com/2010/02/14/robotlegs-as3-signals-and-the-signalcommandmap-example/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 21:39:53 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[object oriented concepts]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[software architecture]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=432</guid>
		<description><![CDATA[Robotlegs and AS3-Signals play really well together. Both apply solid object-oriented principles to accomplish their respective goals. Signals is extremely well suited for automated Dependency Injection. By combining Signals and Robotlegs you are able to eliminate the use of Flash Events in the framework layer of your application. Eliminating Events means eliminating the ambiguity that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://robotlegs.org">Robotlegs</a> and <a href="http://github.com/robertpenner/as3-signals">AS3-Signals</a> play really well together. Both apply solid object-oriented principles to accomplish their respective goals. Signals is extremely well suited for automated Dependency Injection. By combining Signals and Robotlegs you are able to eliminate the use of Flash Events in the framework layer of your application. Eliminating Events means eliminating the ambiguity that can accompany Events and their String registry based approach to the <a href="http://en.wikipedia.org/wiki/Observer_pattern">Observer pattern</a>. Signals provides a strongly-typed object-oriented approach to this same pattern.</p>
<p>With the standard <a href="http://wiki.github.com/robotlegs/robotlegs-framework/best-practices">Robotlegs MVCS implementation</a> you leverage the events provided by Actionscript 3 to communicate amongst the various actors of an application. From models and services dispatching notifications of their actions to triggering commands, events are a core piece of the implementation. To facilitate the use of Signals within MVCS it was necessary to create an extension to allow for Signals to be registered as Command triggers. This need spawned the <a href="http://github.com/joelhooks/signals-extensions-CommandSignal">SignalCommandMap utility</a>.</p>
<p>The SignalCommandMap extends the normal MVCS context and creates a SignalContext. The SignalContext instantiates and provides access to the SignalCommandMap alongside the other maps that are standard to Robotlegs. The SignalCommandMap allows you to map Signal classes and instances to commands that will be executed when the Signal dispatch() method is called. The value objects that are passed in the dispatch are then injected into the command alongside any other mapped injections you have created.</p>
<p>Let's take a look at a simple example that makes use of the SignalCommandMap and discuss some of the underlying code to see how it works:</p>
<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_index_659385376"
			class="flashmovie"
			width="320"
			height="550">
	<param name="movie" value="http://joelhooks.com/examples/robotlegsSignalsCafe/index.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joelhooks.com/examples/robotlegsSignalsCafe/index.swf"
			name="fm_index_659385376"
			width="320"
			height="550">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></div>
<p><a href="http://github.com/joelhooks/robotlegs-examples-RobotlegsSignalsCafe">Source available on Github</a> (<a href="http://github.com/joelhooks/robotlegs-examples-RobotlegsSignalsCafe/zipball/v0.2.4212342">zip</a>)<br />
<span id="more-432"></span><br />
The example is a menu that allows you to add food which is displayed in a list. The total cost of your selected items is displayed and you can remove items from your order. First let's get started by taking a look at the context of the Application, which extends SignalContext:</p>
<h6>SignalCafeContext.as Bootstraps the Application</h6>

<div class="wp_codebox"><table><tr id="p43211"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p432code11"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SignalCafeContext <span style="color: #0066CC;">extends</span> SignalContext
<span style="color: #66cc66;">&#123;</span>
    override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> startup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
    <span style="color: #66cc66;">&#123;</span>
      injector.<span style="color: #006600;">mapSingleton</span><span style="color: #66cc66;">&#40;</span>FoodOrderModel<span style="color: #66cc66;">&#41;</span>;
      injector.<span style="color: #006600;">mapSingleton</span><span style="color: #66cc66;">&#40;</span>FoodOrderUpdated<span style="color: #66cc66;">&#41;</span>;
      injector.<span style="color: #006600;">mapSingleton</span><span style="color: #66cc66;">&#40;</span>FoodItemAddedToOrder<span style="color: #66cc66;">&#41;</span>;
&nbsp;
      signalCommandMap.<span style="color: #006600;">mapSignalClass</span><span style="color: #66cc66;">&#40;</span>AddFoodItemToOrder, AddFoodItemToOrderCommand<span style="color: #66cc66;">&#41;</span>;
      signalCommandMap.<span style="color: #006600;">mapSignalClass</span><span style="color: #66cc66;">&#40;</span>FoodItemSelected, FoodItemSelectedCommand<span style="color: #66cc66;">&#41;</span>;
      signalCommandMap.<span style="color: #006600;">mapSignalClass</span><span style="color: #66cc66;">&#40;</span>RemoveAllOfSelectedItem, RemoveAllSelectedItemCommand<span style="color: #66cc66;">&#41;</span>;
      signalCommandMap.<span style="color: #006600;">mapSignalClass</span><span style="color: #66cc66;">&#40;</span>NoFoodItemSelected, NoFoodItemSelectedCommand<span style="color: #66cc66;">&#41;</span>;
&nbsp;
      mediatorMap.<span style="color: #006600;">mapView</span><span style="color: #66cc66;">&#40;</span>FoodSelectionView, FoodSelectionViewMediator<span style="color: #66cc66;">&#41;</span>;
      mediatorMap.<span style="color: #006600;">mapView</span><span style="color: #66cc66;">&#40;</span>CurrentOrderView, CurrentOrderViewMediator<span style="color: #66cc66;">&#41;</span>;
      mediatorMap.<span style="color: #006600;">mapView</span><span style="color: #66cc66;">&#40;</span>FoodOrderSummaryView, FoodOrderSummaryViewMediator<span style="color: #66cc66;">&#41;</span>;
      mediatorMap.<span style="color: #006600;">mapView</span><span style="color: #66cc66;">&#40;</span>FoodItemRemovalView, FoodItemRemovalViewMediator<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>A SignalContext is structured exactly the same as a standard Robotlegs MVCS Context class. You override the startup() method and bootstrap your application. The major difference here is that you are mapping signals to commands instead of mapping events to commands. With the SignalCommandMap you are not restricted to just using Signals for triggering commands. You could mix events and Signals liberally as your needs or requirements dictated. As a warning, this could quickly became confusing and choosing one or the other might be a saner choice.</p>
<p>SignalCafeContext is mapping 4 Signals to 4 commands. The Signals are typed extensions of the base Signal class. This is necessary to provide Robotlegs (and more specifically in this case SwiftSuspenders) object types to differentiate for the purposes of injection. You could use named injections, but this would rapidly riddle your application with strings that would need to be laboriously checked for accuracy. Avoiding strings in favor of compiler-checked object types is always a good choice.</p>
<p>The strongly typed Signals are relatively simple. They contain a constructor and no additional methods or properties are added to the Signal. You can of course add properties and methods to the extended Signals,, but it wasn't necessary for this example. The SignalCommandMap will accept any class that implements the ISignal interface. Let's take a look at one of the commands triggered by a Signal mapped in the SignalCafeContext:</p>
<h6>AddFoodItemToOrder.as triggers the AddFoodItemToOrderCommand</h6>

<div class="wp_codebox"><table><tr id="p43212"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p432code12"><pre class="actionscirpt" style="font-family:monospace;">public class AddFoodItemToOrder extends Signal
{
	public function AddFoodItemToOrder()
	{
		super(FoodType);
	}
}</pre></td></tr></table></div>

<p>That is the whole of the extended Signal. As mentioned, it is not very complex at all. You will notice that super(FoodType) is being called. Signals take constructor arguments consisting of classes or interfaces that will be used as the value objects transmitted via the dispatch() method. In this case we are using FoodType as this value to ensure that our Signal will carry the payload that the mapped command is expecting.</p>
<p>Command signals are named a bit differently than standard reaction Signals. A Signal that is triggering a command is "requesting action" or specifying an action that needs to occur. Standard signals are typically past tense, or informative, describing an action that has occurred. By using this standard it is much easier to differentiate quickly what each Signal's purpose is. This can help with overall clarity within your application.</p>
<p>The AddFoodItemToOrder signal is dispatched by the FoodSelectionViewMediator which is mediating the DropDownList of FoodTypes and the "Add Some Food" button:</p>
<h6>FoodSelectionViewMediator.as mediates a view and dispatches a Signal when the user has clicked the "Add Some Food" button</h6>

<div class="wp_codebox"><table><tr id="p43213"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code" id="p432code13"><pre class="actionscript" style="font-family:monospace;">	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FoodSelectionViewMediator <span style="color: #0066CC;">extends</span> Mediator
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> view:FoodSelectionView;
&nbsp;
		<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> addItem:AddFoodItemToOrder;
&nbsp;
		override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> onRegister<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			view.<span style="color: #006600;">itemTypeAdded</span>.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>handleItemTypeAdded<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		protected <span style="color: #000000; font-weight: bold;">function</span> handleItemTypeAdded<span style="color: #66cc66;">&#40;</span>itemType:FoodType<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
		<span style="color: #66cc66;">&#123;</span>
			addItem.<span style="color: #006600;">dispatch</span><span style="color: #66cc66;">&#40;</span>itemType<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>When the AddFoodItemToOrder Signal's dispatch(aFoodTypeInstance) is called the AddFoodItemToOrderCommand is triggered:</p>
<h6>AddFoodItemToOrderCommand.as is executed in response to AddFoodItemToOrder Signal dispatch</h6>

<div class="wp_codebox"><table><tr id="p43214"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p432code14"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> AddFoodItemToOrderCommand <span style="color: #0066CC;">extends</span> SignalCommand
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> itemType:FoodType;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> model:FoodOrderModel;
&nbsp;
	override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		model.<span style="color: #006600;">addItemToOrder</span><span style="color: #66cc66;">&#40;</span>itemType<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>AddFoodItemToOrderCommand has two public properties that are marked for injection. The itemType property is a FoodType object. As you will recall, FoodType is the parameter that was passed to the AddFoodItemToOrder Signal super constructor. The AddFoodItemToOrder Signal dispatch() included an instance of a FoodType object which will be injected into the AddFoodItemToOrderCommand alongside any other injections that have been mapped and specified. In this case we are also injecting the FoodOrderModel instance that was mapped as a singleton in the SignalCafeContext.</p>
<div class="note-block">It is important to note that the parameters passed via the Signals dispatch() method will be instantly mapped and unmapped when the command is executed. If you've previously mapped a class that is being delivered via a Signal command mapping, that mapping will be overwritten and removed. To avoid this, favor using typed value objects as Signal parameters.</div>
<p>The AddFoodItemToOrderCommand has a simple job. It accesses the FoodOrderModel instance and calls its addItemToOrder method adding the FoodType parameter that was dispatched with the Signal to trigger the command.</p>
<p>That covers the basics of using the SignalCommandMap within a Robotlegs application. There are options that this example doesn't cover. I would recommend looking through the SignalCommandMap unit test suite for a thorough review of its capabilities. There are several more commands and Signals in the example for you to look over as well. Additionally the example uses Signals within views and the model to dispatch notifications. Outside of binding and UI events, no events are being passed within the application.</p>
<p>Hopefully this will give you the basic understanding of using the SignalCommandMap in a Robotlegs application. Let me know if you have any criticisms, comments, suggestions, or ideas regarding the utility's implementation at <a href="http://knowledge.robotlegs.org">http://knowledge.robotlegs.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/02/14/robotlegs-as3-signals-and-the-signalcommandmap-example/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Robotlegs on RIA Radio with Shaun Smith and Myself</title>
		<link>http://joelhooks.com/2010/01/28/robotlegs-on-ria-radio-with-shaun-smith-and-myself/</link>
		<comments>http://joelhooks.com/2010/01/28/robotlegs-on-ria-radio-with-shaun-smith-and-myself/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 20:43:19 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[robotlegs]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=420</guid>
		<description><![CDATA[Shaun on I were on episode 6 of RIA Radio to talk about Robotlegs. Check it out!]]></description>
			<content:encoded><![CDATA[<div><a href="http://www.insideria.com/2010/01/episode-6-shaun-smith-and-joel.html"><img alt="" src="http://cdn.oreilly.com/digitalmedia/insideria/2009/10/ria-radio-logo-sm.png" title="RIARadio" class="alignleft" width="148" height="93" /></a>Shaun on I were on episode 6 of RIA Radio to talk about Robotlegs. <a href="http://www.insideria.com/2010/01/episode-6-shaun-smith-and-joel.html">Check it out</a>!</div>
<p><br/><br/><br/><br/><br/><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/01/28/robotlegs-on-ria-radio-with-shaun-smith-and-myself/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Robotlegs Image Gallery Example using AS3-Signals and the Presentation Model</title>
		<link>http://joelhooks.com/2010/01/16/robotlegs-image-gallery-example-using-as3-signals-and-the-presentation-model/</link>
		<comments>http://joelhooks.com/2010/01/16/robotlegs-image-gallery-example-using-as3-signals-and-the-presentation-model/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 22:56:36 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[object oriented concepts]]></category>
		<category><![CDATA[robotlegs]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=386</guid>
		<description><![CDATA[Jason Crist posted a thought provoking request for his upcoming presentation comparing Robotlegs and Swiz. He's got a clever knack for stirring the framework ant pile and getting developers eyes off their IDEs long enough to discuss their passions. In this case the developers include Ben Clinkinbeard, Shaun Smith, Jesse Warden and myself. These conversations [...]]]></description>
			<content:encoded><![CDATA[<p>Jason Crist <a href="http://pbking.com/blog/?p=209">posted a thought provoking request</a> for his upcoming presentation comparing <a href="http://www.robotlegs.org">Robotlegs</a> and <a href="http://swizframework.org/">Swiz</a>. He's got a clever knack for stirring the framework ant pile and getting developers eyes off their IDEs long enough to discuss their passions. In this case the developers include <a href="http://www.benclinkinbeard.com/">Ben Clinkinbeard</a>, <a href="http://shaun.boyblack.co.za/blog/">Shaun Smith</a>, <a href="http://jessewarden.com/">Jesse Warden</a> and myself.</p>
<p>These conversations are always good natured. While we work on (or use) "competing" frameworks there is always a sense of mutual respect. We like our tools but have obvious inclinations towards the projects that we've invested our hearts and souls into.</p>
<p>Ben Clinkinbeard has pointed out (several times!) that Robotlegs is all about extending the <a href="http://github.com/robotlegs/robotlegs-framework/tree/master/src/org/robotlegs/mvcs/">MVCS classes</a>. My stock answer is that there is a clear separation between the framework and the concrete MVCS implementation. To paraphrase Ben, "Well show it to me then!"</p>
<p>All of the <a href="http://www.robotlegs.org/examples/">"official" Robotlegs examples</a> are making use of the MVCS implementation. Why? Because it is solid, recognizable, and fairly easy to get one's head around. It provides a common ground for developers and a set architectural structure which is a huge advantage in any team environment. It is important to make the distinction  between the framework and the MVCS implementation. What does that even mean? At the core, Robotlegs is a modular set of tools to provide a convenient mechanism for wiring applications. Robotlegs is not doing class reflection. Robotlegs is not an automated dependency injection solution. Robotlegs is  an adapter to a dependency injection solution,by default the lightweight <a href="http://github.com/tschneidereit/SwiftSuspenders">SwiftSuspenders library</a>. Through a set of tools, namely the MediatorMap, CommandMap, ViewMap, and the injection adapter Robotlegs provides a robust starting place to begin coding your application.</p>
<p>The MVCS implementation is a set of base classes loosely modeled on <a href="http://puremvc.org/">PureMVC</a>. At the heart of the implementation is the Context. The Context creates instances of the various mapping classes, the injection adapter, and gives the developer a centralized IEventDispatcher that can be used for messaging between application tiers.. The other three classes, Actor, Mediator, and Command, reduce boiler plate and provide convenient access to injected dependencies typically used in the the MVCS tiers.</p>
<p>What if you hate PureMVC, don't want to extend any framework classes, or generally just want to work in a different way outside of a prescribed MVCS architecture?</p>
<p>No problem.</p>
<p>Here's the deal. Robotlegs, the framework, is a <a href="http://github.com/robotlegs/robotlegs-framework/tree/master/src/org/robotlegs/core/">set of interfaces</a>. You can effectively do whatever you want with these interfaces. You can make use of the base concrete implementations of the core interfaces, use a class from the MVCS implementation, implement your own concrete classes based on the framework core, bring in other libraries or any combination you can think of. In terms of a framework, Robotlegs can be whatever you want/need it to be.</p>
<h2>Man Joel, that was a long intro. Where's the freaking code??!?</h2>
<p><span id="more-386"></span><br />
So, to that end, I sat down to rework <a href="http://joelhooks.com/2009/07/17/robotlegs-as3-a-dependency-injection-driven-mvcs-framework-for-flashflex-–-inspired-by-puremvc/">my first (and still favorite) Robotlegs example application</a> and demonstrate this concept a bit.</p>
<p>I've stripped the example down slightly, using just the XMLImageService and not connecting to Flickr (in an effort to keep it simple).</p>
<p><a href="http://github.com/joelhooks/robotlegs-examples-ImageGalleryPM">Get the source on GitHub</a><br />
<a href="http://github.com/joelhooks/robotlegs-examples-ImageGalleryPM/zipball/v1.0.0"><strong>Download the full source as a Zip</strong></a></p>
<p><strong>This example requires:</strong><br />
<a href="http://www.robotlegs.org/">Robotlegs</a><br />
<a href="http://github.com/robertpenner/as3-signals">AS3-Signals</a><br />
<a href="http://github.com/joelhooks/signals-extensions-CommandSignal">SignalsCommandMap library</a><br />
<a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">Flex 4 SDK (a fairly recent version)</a></p>
<div class="note-block" align="center"><strong>You neeed <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4">SDK version 4.0.0.12635 or later</a> to compile this...</strong></div>
<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_index_1673530206"
			class="flashmovie"
			width="400"
			height="500">
	<param name="movie" value="http://joelhooks.com/examples/robotlegsGalleryPM/index.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joelhooks.com/examples/robotlegsGalleryPM/index.swf"
			name="fm_index_1673530206"
			width="400"
			height="500">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></div>
<p><br/><br />
The example should be familiar if you've looked at the Image Gallery previously. It loads images from a service and displays them. This version is much different on the code level however. Instead of mediators and data models, the gallery is using presentation models and AS3-Signals. It still uses the Context from the MVCS implementation. it's so f'n handy and I don't want to manually instantiate the maps.</p>
<h3>ImageGalleryContext</h3>

<div class="wp_codebox"><table><tr id="p38623"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code" id="p386code23"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ImageGalleryContext <span style="color: #0066CC;">extends</span> Context
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> const VIEW_PACKAGE:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;org.robotlegs.examples.imagegallery.view.components&quot;</span>;
	<span style="color: #0066CC;">private</span> const LOAD_GALLERY:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;loadGallery&quot;</span>;
&nbsp;
	override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> startup<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">//map the views</span>
		viewMap.<span style="color: #006600;">mapPackage</span><span style="color: #66cc66;">&#40;</span>VIEW_PACKAGE<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">//map the presentation models</span>
		injector.<span style="color: #006600;">mapSingletonOf</span><span style="color: #66cc66;">&#40;</span> IGalleryViewPresentationModel, GalleryViewPresentationModel <span style="color: #66cc66;">&#41;</span>;
		injector.<span style="color: #006600;">mapSingletonOf</span><span style="color: #66cc66;">&#40;</span> IGalleryThumbnailsPresentationModel, GalleryThumbnailsPresentationModel <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">//map the services and their factories</span>
		injector.<span style="color: #006600;">mapSingletonOf</span><span style="color: #66cc66;">&#40;</span> IGalleryImageService, XMLImageService <span style="color: #66cc66;">&#41;</span>;
		injector.<span style="color: #006600;">mapSingletonOf</span><span style="color: #66cc66;">&#40;</span> IGalleryFactory, XMLGalleryFactory <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">//map the signals</span>
		injector.<span style="color: #006600;">mapSingleton</span><span style="color: #66cc66;">&#40;</span>GalleryUpdatedSignal<span style="color: #66cc66;">&#41;</span>;
		injector.<span style="color: #006600;">mapSingleton</span><span style="color: #66cc66;">&#40;</span>GalleryImageSelectedSignal<span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">//map the command</span>
		commandMap.<span style="color: #006600;">mapEvent</span><span style="color: #66cc66;">&#40;</span> LOAD_GALLERY, LoadGalleryCommand <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">//go!!</span>
		eventDispatcher.<span style="color: #006600;">dispatchEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Event<span style="color: #66cc66;">&#40;</span>LOAD_GALLERY<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>As you can see here the context is performing the duty of mapping the injections the application will use.</p>
<h3>Automated Dependency Injected View</h3>

<div class="wp_codebox"><table><tr id="p38624"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code" id="p386code24"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>s:Group xmlns:fx=<span style="color: #ff0000;">&quot;http://ns.adobe.com/mxml/2009&quot;</span>
		 xmlns:s=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/spark&quot;</span>
		 xmlns:mx=<span style="color: #ff0000;">&quot;library://ns.adobe.com/flex/halo&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>fx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">robotlegs</span>.<span style="color: #006600;">examples</span>.<span style="color: #006600;">imagegallery</span>.<span style="color: #006600;">view</span>.<span style="color: #006600;">models</span>.<span style="color: #006600;">IGalleryThumbnailsPresentationModel</span>;
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _model:IGalleryThumbnailsPresentationModel;
&nbsp;
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> model<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:IGalleryThumbnailsPresentationModel
			<span style="color: #66cc66;">&#123;</span>
				<span style="color: #b1b100;">return</span> _model;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
			<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> model<span style="color: #66cc66;">&#40;</span>value:IGalleryThumbnailsPresentationModel<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				_model = value;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>fx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>s:Rect <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
			<span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;</span>s:fill<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>s:SolidColor <span style="color: #0066CC;">color</span>=<span style="color: #ff0000;">&quot;#111111&quot;</span><span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;/</span>s:fill<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>s:Rect<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>s:Group <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span><span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;</span>s:layout<span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>s:VerticalLayout gap=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;/</span>s:layout<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;</span>s:DataGroup id=<span style="color: #ff0000;">&quot;dgThumbnails&quot;</span>
					 clipAndEnableScrolling=<span style="color: #ff0000;">&quot;true&quot;</span>
					 dataProvider=<span style="color: #ff0000;">&quot;{model.dataProvider}&quot;</span>
					 <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
					 <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;85&quot;</span>
					 itemRenderer=<span style="color: #ff0000;">&quot;org.robotlegs.examples.imagegallery.view.components.renderers.GalleryImageThumbnailItemRenderer&quot;</span><span style="color: #66cc66;">&gt;</span>
			<span style="color: #66cc66;">&lt;</span>s:layout<span style="color: #66cc66;">&gt;</span>
				<span style="color: #66cc66;">&lt;</span>s:HorizontalLayout gap=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #66cc66;">/&gt;</span>
			<span style="color: #66cc66;">&lt;/</span>s:layout<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;/</span>s:DataGroup<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;</span>s:HScrollBar id=<span style="color: #ff0000;">&quot;thumbScrollBar&quot;</span>
					  viewport=<span style="color: #ff0000;">&quot;{dgThumbnails}&quot;</span>
					  <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span>
					  smoothScrolling=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>s:Group<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>s:Group<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>The viewMap is set to map the entire components folder. This is a convenient way to provide automated dependency injection to a large number of views. It also maps views in any sub-package of the mapped package.</p>
<h3>GalleryViewThumbnailsPresentationModel</h3>

<div class="wp_codebox"><table><tr id="p38625"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
</pre></td><td class="code" id="p386code25"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GalleryThumbnailsPresentationModel <span style="color: #0066CC;">implements</span> IGalleryThumbnailsPresentationModel
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> updated:GalleryUpdatedSignal;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> imageSelected:GalleryImageSelectedSignal;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>PostConstruct<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> mapSignalListeners<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		updated.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>galleryUpdated<span style="color: #66cc66;">&#41;</span>;
		imageSelected.<span style="color: #0066CC;">add</span><span style="color: #66cc66;">&#40;</span>updateImageSelectionState<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _dataprovider:ArrayCollection;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> dataProvider<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:ArrayCollection
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">return</span> _dataprovider;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> dataProvider<span style="color: #66cc66;">&#40;</span>v:ArrayCollection<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		_dataprovider = v;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> galleryUpdated<span style="color: #66cc66;">&#40;</span>gallery:Gallery<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		dataProvider = gallery.<span style="color: #006600;">photos</span>;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>gallery.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			imageSelected.<span style="color: #006600;">dispatch</span><span style="color: #66cc66;">&#40;</span>gallery.<span style="color: #006600;">photos</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> updateImageSelectionState<span style="color: #66cc66;">&#40;</span>image:GalleryImage<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">for</span> <span style="color: #b1b100;">each</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> galleryImage:GalleryImage <span style="color: #b1b100;">in</span> dataProvider<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			galleryImage.<span style="color: #006600;">selected</span> = galleryImage == image;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<h3>IGalleryViewThumbnailsPresentationModel</h3>

<div class="wp_codebox"><table><tr id="p38626"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p386code26"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * This interface is simple because the application is simple. Obviously in
 * a large application you'd get more complex interfaces.
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">interface</span> IGalleryThumbnailsPresentationModel
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> dataProvider<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:ArrayCollection;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The presentation models are provided as singletons. The application will only display one of each view that requires the model. They are also mapped as interfaces with the interfaces being injected into the views. With the presentation model, the view does not update the model directly. By using interfaces we can supply read-only contracts between the presentation models and the views they control:</p>
<h3>XMLImageService</h3>

<div class="wp_codebox"><table><tr id="p38627"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code" id="p386code27"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> XMLImageService <span style="color: #0066CC;">implements</span> IGalleryImageService
<span style="color: #66cc66;">&#123;</span>
	protected <span style="color: #0066CC;">static</span> const BASE_URL:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;assets/gallery/&quot;</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> galleryFactory:IGalleryFactory;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> galleryUpdated:GalleryUpdatedSignal;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> XMLImageService<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> loadGallery<span style="color: #66cc66;">&#40;</span><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> service:HTTPService = <span style="color: #000000; font-weight: bold;">new</span> HTTPService<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> responder:Responder = <span style="color: #000000; font-weight: bold;">new</span> Responder<span style="color: #66cc66;">&#40;</span>handleServiceResult, handleServiceFault<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #000000; font-weight: bold;">var</span> token:AsyncToken;
		service.<span style="color: #006600;">resultFormat</span> = <span style="color: #ff0000;">&quot;e4x&quot;</span>;
		service.<span style="color: #0066CC;">url</span> = BASE_URL+<span style="color: #ff0000;">&quot;gallery.xml&quot;</span>;
		token = service.<span style="color: #0066CC;">send</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		token.<span style="color: #006600;">addResponder</span><span style="color: #66cc66;">&#40;</span>responder<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	protected <span style="color: #000000; font-weight: bold;">function</span> handleServiceResult<span style="color: #66cc66;">&#40;</span>event:<span style="color: #0066CC;">Object</span><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> gallery:Gallery = galleryFactory.<span style="color: #006600;">createGallery</span><span style="color: #66cc66;">&#40;</span>event.<span style="color: #006600;">result</span>.<span style="color: #006600;">image</span>, BASE_URL<span style="color: #66cc66;">&#41;</span>;
		galleryUpdated.<span style="color: #006600;">dispatch</span><span style="color: #66cc66;">&#40;</span> gallery <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	protected <span style="color: #000000; font-weight: bold;">function</span> handleServiceFault<span style="color: #66cc66;">&#40;</span>event:<span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<h3>IGalleryImageService</h3>

<div class="wp_codebox"><table><tr id="p38628"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p386code28"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #0066CC;">interface</span> IGalleryImageService
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> loadGallery<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The service and its factory class are also mapped as singleton interfaces. This makes it really easy to swap out services (to add a Flickr service for example).</p>
<h3>GalleryUpdatedSignal</h3>

<div class="wp_codebox"><table><tr id="p38629"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p386code29"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GalleryUpdatedSignal <span style="color: #0066CC;">extends</span> Signal
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> GalleryUpdatedSignal<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span>Gallery<span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The signals are simple classes that merely extend the Signal class and declare their payload type in the super() of the constructor. Signals are a really marvelous concept and provide a lot of very nice functionality. They make a great companion to Robotlegs and I think you will see some really cool stuff being done with Signals and Robotlegs in the very near future.</p>
<h3>LoadGalleryCommand</h3>

<div class="wp_codebox"><table><tr id="p38630"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p386code30"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> LoadGalleryCommand
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #66cc66;">&#91;</span>Inject<span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> service:IGalleryImageService;
&nbsp;
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
	<span style="color: #66cc66;">&#123;</span>
		service.<span style="color: #006600;">loadGallery</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>The application has a single command, LoadGalleryCommand, that is used to actually load the initial images from service and is only called once. In fact, the event that is fired to launch this command in the context startup method is the only event that this application uses (outside of the Flex events on the UI items). That is awesome!</p>
<p>Something you will notice right away looking at the source is that the ImageGalleryContext is the only class that extends a Robotlegs class. You could do without that too, frankly, and create your own context that created the maps and injector instances. I'm not a masochist however, and I will use the provided context for this example. There is a huge amount of potential there for implementing your own custom contexts. I think an interesting implementation might pitch Flash Events altogether and use only Signals for communication between application actors. This example is essentially doing that, but I'd like to get rid of that single event in startup too!</p>
<p><a href="http://github.com/joelhooks/robotlegs-examples-ImageGalleryPM/zipball/v1.0.0"><strong>Download the full source as a Zip</strong></a></p>
<p>Let me know if you make something cool with Robotlegs and post details about it, I've got a stack of these to give away:</p>
<div align="center"><a href="http://69.164.207.135/wp-content/uploads/2010/01/photo.jpg"><img src="http://joelhooks.com/wp-content/uploads/2010/01/photo-225x300.jpg" alt="photo" title="photo" width="225" height="300" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2010/01/16/robotlegs-image-gallery-example-using-as3-signals-and-the-presentation-model/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Continuous Scrolling Thumbnail Component for Flex</title>
		<link>http://joelhooks.com/2009/12/24/continuous-scrolling-thumbnail-component-for-flex/</link>
		<comments>http://joelhooks.com/2009/12/24/continuous-scrolling-thumbnail-component-for-flex/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 04:37:27 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[components]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=378</guid>
		<description><![CDATA[This post continues to be the most popular on this space after a year and a half. I've never been particularly fond of the implmenetation. Tightly coupled to very specific data sets and not really anything like a Flex component. It is setup more like an application (because it was pulled out of an application [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelhooks.com/2008/05/11/continuous-scrolling-image-thumbnail-and-slideshow-component-for-flex/">This post</a> continues to be the most popular on this space after a year and a half. I've never been particularly fond of the implmenetation. Tightly coupled to very specific data sets and not really anything like a Flex component. It is setup more like an application (because it was pulled out of an application and generalized).</p>
<p>I've finally found the opportunity to rewrite the continuous scrolling thumbnail view portion of the slideshow and I am much happier with the results. Now, instead of resembling an application it is structured like a standard Flex 3 List based component. You supply it with a dataProvider and an itemRenderer (IListItemRenderer) and it acts as you would expect it to.</p>
<p>This approach is much nicer, as the data is cleanly decoupled from the component implementation and it opens up the doors for reuse.</p>
<p><a href="http://github.com/joelhooks/components-thumbScroller">The code is available on Github</a>. If you have any suggestions or would like to add to the component, fork it and let me know!</p>
<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_SimpleSlideshow_633021675"
			class="flashmovie"
			width="450"
			height="600">
	<param name="movie" value="http://joelhooks.com/examples/thumbScroller/SimpleSlideshow.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://joelhooks.com/examples/thumbScroller/SimpleSlideshow.swf"
			name="fm_SimpleSlideshow_633021675"
			width="450"
			height="600">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object></div>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2009/12/24/continuous-scrolling-thumbnail-component-for-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Robotlegs MVCS: Walkthrough of an AIR Twitter Client</title>
		<link>http://joelhooks.com/2009/11/11/a-walkthrough-of-an-air-twitter-client-using-robotlegs-mvcs/</link>
		<comments>http://joelhooks.com/2009/11/11/a-walkthrough-of-an-air-twitter-client-using-robotlegs-mvcs/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:46:56 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[robotlegs]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[MVCS]]></category>

		<guid isPermaLink="false">http://joelhooks.com/?p=349</guid>
		<description><![CDATA[Here is the "completed" project on Github. This is a roughly 25 minute walkthrough of wiring together a Twitter client using the Robotlegs AS3 Micro-Architecture MVCS implementation. It covers setting up the context, using commands, mediating composite view component, granular view component mediation, and retrieving data from a service. Apologies in advance for the ambient [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joelhooks.com/video/rl_twitter.mov" rel="shadowbox;height=568;width=960"><img src="http://69.164.207.135/wp-content/uploads/2009/11/rl_twit_ss.png" alt="rl_twit_ss" title="rl_twit_ss" width="490" height="257" class="aligncenter size-full wp-image-354" /></a></p>
<p><a href="http://github.com/joelhooks/robotlegs-examples-Twitter"><strong>Here is the "completed" project on Github.</strong></a></p>
<p>This is a roughly 25 minute walkthrough of wiring together a Twitter client using the Robotlegs AS3 Micro-Architecture MVCS implementation. It covers setting up the context, using commands, mediating composite view component, granular view component mediation, and retrieving data from a service.</p>
<p>Apologies in advance for the ambient noise. 4 kids, 2 dogs, and a busy wife does not make the perfect sound booth <img src='http://joelhooks.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I am considering expanding on this example and creating a start to finish video series creating a full Twitter client with Robotlegs. This would cover the actual component building, wiring everything together, working with data models (local storage, etc), and refining the application to use the advanced features available with the Twitter API using TDD the whole time for development. Is this something that you'd be interested in?</p>
]]></content:encoded>
			<wfw:commentRss>http://joelhooks.com/2009/11/11/a-walkthrough-of-an-air-twitter-client-using-robotlegs-mvcs/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
<enclosure url="http://joelhooks.com/video/rl_twitter.mov" length="25935872" type="video/quicktime" />
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
	</item>
	</channel>
</rss>
