<?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/"
	>

<channel>
	<title>Richard Lord &#187; SmartyPants</title>
	<atom:link href="http://www.richardlord.net/blog/tag/smartypants/feed" rel="self" type="application/rss+xml" />
	<link>http://www.richardlord.net</link>
	<description>Actionscript/Flex, PHP and Java developer</description>
	<lastBuildDate>Mon, 23 Jan 2012 17:07:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Transforming the designer-developer workflow</title>
		<link>http://www.richardlord.net/blog/transforming-the-designer-developer-workflow</link>
		<comments>http://www.richardlord.net/blog/transforming-the-designer-developer-workflow#comments</comments>
		<pubDate>Tue, 16 Mar 2010 17:58:42 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[360Flex]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Signals]]></category>
		<category><![CDATA[SmartyPants]]></category>

		<guid isPermaLink="false">http://www.richardlord.net/?p=505</guid>
		<description><![CDATA[<p>Here are the slides and example code from my presentation, Transforming the designer-developer workflow, at 360&#124;Flex San Jose on 8th March 2010...</p>]]></description>
			<content:encoded><![CDATA[<p>Here are the slides from my presentation, Transforming the designer-developer workflow, shown at 360|Flex San Jose on 8th March 2010.</p>

<p style="text-align:center"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flex-2010-100312133322-phpapp01&#038;rel=0&#038;stripped_title=transforming-the-designerdeveloper-workflow-3413021" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=360flex-2010-100312133322-phpapp01&#038;rel=0&#038;stripped_title=transforming-the-designerdeveloper-workflow-3413021" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>

<p style="text-align:center"><a href="/files/360FlexSJ10CodeExample.zip"><b>Download the example code</b></a></p>
<p>The <a href="/files/360FlexSJ10CodeExample.zip">example code</a> is a set of smart components implementing this architecture and designed for building a Twitter client. Also included is an example of their use. This code was used during the presentation.</p>

<p>Links:</p>
<ul>
<li><a href="http://github.com/sophistifunk/SmartyPants-IOC">SmartyPants-IOC</a></li>
<li><a href="http://github.com/robertpenner/as3-signals">As3-Signals</a></li>
<li><a href="http://github.com/srohde/Twitter">AS3 OAuth Twitter Library</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.richardlord.net/blog/transforming-the-designer-developer-workflow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smartypants-ioc and As3-signals example</title>
		<link>http://www.richardlord.net/blog/flexcaster-smartysignals</link>
		<comments>http://www.richardlord.net/blog/flexcaster-smartysignals#comments</comments>
		<pubDate>Thu, 19 Nov 2009 20:19:58 +0000</pubDate>
		<dc:creator>Richard</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Signals]]></category>
		<category><![CDATA[SmartyPants]]></category>

		<guid isPermaLink="false">http://www.bigroom.co.uk/blog/flexcaster-smartysignals</guid>
		<description><![CDATA[<p>During my recent presentation at <a href="http://www.lfpug.com/29th-october-2009-29102009/">LFPUG</a>, <a href="http://tink.ws/blog">Tink</a> was very persistent in suggesting that the event bus used in most MVC frameworks might not be the best solution. This got me thinking about what it would be like to do MVC without an event bus. And so began this little experiment...</p>]]></description>
			<content:encoded><![CDATA[<p>During my recent presentation at <a href="http://www.lfpug.com/29th-october-2009-29102009/">LFPUG</a>, <a href="http://tink.ws/blog">Tink</a> was very persistent in suggesting that the event bus used in most MVC frameworks might not be the best solution. This got me thinking about what it would be like to do MVC without an event bus. And so began this little experiment.</p>

<h3>You can take away my event bus, but don&#8217;t take away my dependency injection.</h3>

<p>My project was to create the same podcast application as I used in my various framework examples, but this time without any form of central event bus. Initial thoughts suggested I would need a dependency injection container to maintain loose coupling, so I grabbed my favourite one &#8211; <a href="http://smartypants.expantra.net/">SmartyPants-ioc</a>, created by <a href="http://flex.joshmcdonald.info/">Josh MacDonald</a>.<p>

<p>Using SmartyPants and lots of interfaces I can inject my objects where they&#8217;re needed while only creating dependencies on the interfaces not the actual implementations. Thus (hopefully) I can avoid needing an event bus for communication. For example, view mediators (I used the presentation model pattern) have controllers injected into them and call their methods directly. But they only know the interface of the controller, not the actual implementation.</p>

<p>This looks good to start with, but unfortunately I still need events for some things. The obvious example is notification of results from asynchronous service calls, but notification of changes to the model also works well when handled by events. Because I don&#8217;t have an event bus, these events will be dispatched by specific objects and must be listened for on those specific objects too.</p>

<h3>Does that object dispatch an event or not?</h3>

<p>Unfortunately I&#8217;m coding to interfaces, and there&#8217;s no way to define what events must be dispatched from a class that implements an interface. I could work on trust &#8211; assume any object that implements the FeedLoader interface will dispatch a feedLoadComplete event, for example. But if I want my solution to be truly practical, I need something more robust than that.</p>

<p>One of the many nice features of <a href="http://github.com/robertpenner/as3-signals">As3-signals</a>, created by <a href="http://robertpenner.com/flashblog/">Robert Penner</a>, is that the signals are properties of classes so they can be specified in an interface. For this reason I chose to use As3-signals for my events.</p>

<p>For example, the previously mentioned FeedLoader interface defines a getter for the feedLoadCompleteSignal. Now any class that implements this interface must have that getter, and any class injected with an implementation of this interface can trust that that getter will be there, and so listen for the underlying signal.</p>

<h3>In conclusion</h3>

<p>All in all I think it worked out rather well. There may even be a potential future in an architecture like this. I do fear the explosion of interfaces and injection rules may make the approach unwieldy for a large project, but perhaps multiple DI configuration classes, a clear package structure and disciplined developers is all that&#8217;s required. I welcome your opinions on this.</p>

<p>The example is below. Right click on the swf to view the source. Links to the framework versions follow. All versions have identical functionality.</p>

<div class="spaced"><div id="swf4f2ea4755a689">
<p><b>Flash required:</b> You need version 10 or later of the free Flash player from Adobe to use this content. To download and install the free player from Adobe's web site <a href="http://get.adobe.com/flashplayer/">click here</a>.</p>
</div>
<script type="text/javascript">
var params = {loop:"false",quality:"high",allowfullscreen:"true"};
var flashvars = {};
swfobject.embedSWF("/images/blog/flexcaster/Flexcaster_smartysignals.swf", "swf4f2ea4755a689", "400", "500", "10.0.0", "/swf/expressInstall.swf", flashvars, params, {} );
</script></div>

<p>The other versions can be viewed here&#8230;</p>
<ul>
<li><a href="flexcaster-flex3">Flexcaster no framework project source</a></li>
<li><a href="flexcaster-cairngorm">Flexcaster Cairngorm project source</a></li>
<li><a href="flexcaster-puremvc">Flexcaster PureMVC project source</a></li>
<li><a href="flexcaster-mate">Flexcaster Mate project source</a></li>
<li><a href="flexcaster-swiz">Flexcaster Swiz project source</a></li>
<li><a href="flexcaster-parsley">Flexcaster Parsley project source</a></li>
<li><a href="flexcaster-robotlegs">Flexcaster Robotlegs project source</a></li>
<li><a href="flexcaster-spring">Flexcaster Spring Actionscript project source</a></li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.richardlord.net/blog/flexcaster-smartysignals/feed</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
	</channel>
</rss>

