<?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>Christophe Herreman</title>
	<atom:link href="http://www.herrodius.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.herrodius.com/blog</link>
	<description>Thoughts from a software developer</description>
	<lastBuildDate>Fri, 26 Jun 2009 10:32:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Maven, Flex Mojos and Flash Builder 4 tip</title>
		<link>http://www.herrodius.com/blog/169</link>
		<comments>http://www.herrodius.com/blog/169#comments</comments>
		<pubDate>Fri, 26 Jun 2009 10:32:57 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[tips 'n tricks]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/?p=169</guid>
		<description><![CDATA[Here's a quick tip for those of you who are using Flash Builder 4's FlexUnit integration and also build with Maven and Flex Mojos.
When executing the unit tests of your library project or application, Flash Builder creates a FlexUnitApplication.mxml file in the root package of your main class path. This file is the test runner [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a quick tip for those of you who are using Flash Builder 4's FlexUnit integration and also build with <a href="http://maven.apache.org/">Maven</a> and <a href="http://code.google.com/p/flex-mojos/">Flex Mojos</a>.</p>
<p>When executing the unit tests of your library project or application, Flash Builder creates a FlexUnitApplication.mxml file in the root package of your main class path. This file is the test runner UI that gets compiled when the tests are run. The problem is that when you try to execute a Maven build on your project, the build will fail because the test runner UI will also get compiled.</p>
<p>A solution is to use the <a href="http://maven.apache.org/plugins/maven-clean-plugin/">maven-clean-plugin</a> in the build phase and configure it to delete the FlexUnitApplication.mxml file.</p>
<p>To use it, place the following xml in the "build/plugins" section of your Maven build file. You might need to change the "directory" setting to match your classpath.</p>
<div class="igBar"><span id="lxml-2"><a href="#" onclick="javascript:showPlainTxt('xml-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-2">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;plugin<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span>maven-clean-plugin<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/artifactId<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;configuration<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filesets<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;directory<span style="font-weight: bold; color: black;">&gt;</span></span></span>src/main/actionscript<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/directory<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;includes<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;include<span style="font-weight: bold; color: black;">&gt;</span></span></span>FlexUnitApplication.mxml<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/include<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/includes<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/fileset<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filesets<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/configuration<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/plugin<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you now execute a "mvn clean install" command, the file will be removed and the build should succeed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/169/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Formatter Eclipse Plug-in</title>
		<link>http://www.herrodius.com/blog/165</link>
		<comments>http://www.herrodius.com/blog/165#comments</comments>
		<pubDate>Fri, 05 Jun 2009 15:11:38 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[tips 'n tricks]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/165</guid>
		<description><![CDATA[If you're using Eclipse and Flash/Flex Builder, you might want to have a look at the Flex Formatter Plug-in. It's a great add-on that allows you to (auto-)format your ActionScript and MXML files, based on the templates you define.
This is a key feature that is still missing in Flash/Flex Builder in my opinion.
More info: http://sourceforge.net/projects/flexformatter/
]]></description>
			<content:encoded><![CDATA[<p>If you're using Eclipse and Flash/Flex Builder, you might want to have a look at the Flex Formatter Plug-in. It's a great add-on that allows you to (auto-)format your ActionScript and MXML files, based on the templates you define.</p>
<p>This is a key feature that is still missing in Flash/Flex Builder in my opinion.</p>
<p>More info: <a href="http://sourceforge.net/projects/flexformatter/">http://sourceforge.net/projects/flexformatter/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/165/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Spring ActionScript: site and documentation update</title>
		<link>http://www.herrodius.com/blog/164</link>
		<comments>http://www.herrodius.com/blog/164#comments</comments>
		<pubDate>Tue, 02 Jun 2009 08:00:23 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Spring ActionScript]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/164</guid>
		<description><![CDATA[Some quick news about the status of the project.
The Spring ActionScript project has a new home at http://www.springactionscript.org!
We have been updating the documentation extensively and although this is still a work in progress, this should be a valuable resource to get started with the framework. Please see the "Documentation" section for more info and available [...]]]></description>
			<content:encoded><![CDATA[<p>Some quick news about the status of the project.</p>
<p>The Spring ActionScript project has a new home at <a href="http://www.springactionscript.org">http://www.springactionscript.org</a>!</p>
<p>We have been updating the documentation extensively and although this is still a work in progress, this should be a valuable resource to get started with the framework. Please see the "Documentation" section for more info and available doc formats.</p>
<p>There are also some neat new features like advanced autowiring and support for custom XML namespaces (available in SVN) that will be distributed with the new 0.8 release, expected to be released by the end of this week.</p>
<p>As usual, we appreciate any feedback. Join our <a href="http://groups.google.com/group/springactionscript-dev">Google developers group</a> or the <a href="http://forum.springsource.org/forumdisplay.php?f=60">forum</a>.</p>
<p>Have fun coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/164/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing the AS3Commons project</title>
		<link>http://www.herrodius.com/blog/163</link>
		<comments>http://www.herrodius.com/blog/163#comments</comments>
		<pubDate>Mon, 01 Jun 2009 08:30:52 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[AS3Commons]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/163</guid>
		<description><![CDATA[While working on the Spring ActionScript framework, we wrote a lot of code that could perfectly be used outside of the framework. That's why we decided to start the AS3Commons project, based on idea of the Apache Commons project, and provide a set of core libraries useful to every ActionScript 3.0 developer.
This announcement is also [...]]]></description>
			<content:encoded><![CDATA[<p>While working on the <a href="http://www.springactionscript.org">Spring ActionScript</a> framework, we wrote a lot of code that could perfectly be used outside of the framework. That's why we decided to start the AS3Commons project, based on idea of the Apache Commons project, and provide a set of core libraries useful to every ActionScript 3.0 developer.</p>
<p>This announcement is also the immediate release of 2 of the libraries included:</p>
<ul>
<li>AS3Commons-Reflect: a reflection library</li>
<li>AS3Commons-Logging: an abstraction layer over logging frameworks</li>
</ul>
<p><em>Note: we realize there is another as3commons library out there. However this library is no longer being maintained and developed as confirmed by the author. We apologize in advance for the confusion this might cause. We are currently looking into the code and will try to include/replace the functionality in the new project.</em></p>
<p><strong>AS3Commons-Reflect</strong></p>
<p>This is a reflection library, or a clear API written around describeType(). It allows you to get runtime information about classes and objects running in your application, like the properties and methods available in a class, the metadata associated with a certain property, ... and it also allows you to dynamically instantiate objects and invoke their methods.</p>
<p>We had previously moved this from the Spring ActionScript sources to the AS3Reflect project. However, since we had plans of extracting other part of the framework as well, we decided to bundle everything under the AS3Commons project. The AS3Reflect library is hence no longer available and we advice all users to update to the new release.</p>
<p>For more info, please see <a href="http://www.as3commons.org/as3-commons-reflect">http://www.as3commons.org/as3-commons-reflect</a></p>
<p><strong>AS3Commons-Logging</strong></p>
<p>This is a logging abstraction layer over existing logging frameworks. It is a lightweight library that offers a logger interface and a set of adapters and decorators for existing logging frameworks, like the logging API in the Flex framework.</p>
<p>It is perfectly fit for library and framework developers that want to enable logging information in their distributed libraries without tying their code to a specific logging framework. Logging happens via the logger interfaces provided by AS3Commons-Logging and users are then able to configure the logger with the implementation they prefer.</p>
<p>Here's a small example:</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// configure the LoggerFactory with the Flex logging framework</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> loggerSetup:* = <span style="color: #66cc66;">&#40;</span>LoggerFactory.<span style="color: #006600;">loggerFactory</span> = <span style="color: #000000; font-weight: bold;">new</span> FlexLoggerFactory<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// get a logger from the factory, in which all log statements will be handled by the Flex logger</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> logger:ILogger = LoggerFactory.<span style="color: #006600;">getLogger</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"com.domain.MyClass"</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>We will update the project with new adapters for existing logging frameworks. Let us know if you have any framework that you would like to see supported.</p>
<p>For more info, please see: <a href="http://www.as3commons.org/as3-commons-logging">http://www.as3commons.org/as3-commons-logging</a></p>
<p><strong>Get Involved</strong></p>
<p>We welcome participation from all that are interested, at all skill levels. Coding, documentation and testing are all critical parts of the software development process. If you are interested in participating in any of these aspects, please join us! You can leave a comment or mail me at christophe.herreman [at] gmail [dot] com.</p>
<p><a href="http://www.as3commons.org">www.as3commons.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/163/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Streaming AMF not working on Internet Explorer 8</title>
		<link>http://www.herrodius.com/blog/162</link>
		<comments>http://www.herrodius.com/blog/162#comments</comments>
		<pubDate>Mon, 25 May 2009 12:55:52 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[BlazeDS]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/162</guid>
		<description><![CDATA[If you're having trouble connecting to BlazeDS via a streaming AMF channel on IE 8, be warned: this is a known issue currently reported in the Adobe bugbase and a workaround is provided. You need to specify the "max-streaming-clients" in the configuration of the channel (in services-config.xml):
PLAIN TEXT
CODE:




&#60;channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel"&#62;


&#160; &#60;endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/&#62;


&#160; &#60;properties&#62;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>If you're having trouble connecting to BlazeDS via a streaming AMF channel on IE 8, be warned: this is a known issue <a href="http://bugs.adobe.com/jira/browse/BLZ-378">currently reported in the Adobe bugbase</a> and a workaround is provided. You need to specify the "max-streaming-clients" in the configuration of the channel (in services-config.xml):</p>
<div class="igBar"><span id="lcode-6"><a href="#" onclick="javascript:showPlainTxt('code-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-6">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;channel-definition id=<span style="color:#CC0000;">"my-streaming-amf"</span> class=<span style="color:#CC0000;">"mx.messaging.channels.StreamingAMFChannel"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;endpoint url=<span style="color:#CC0000;">"http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"</span> class=<span style="color:#CC0000;">"flex.messaging.endpoints.StreamingAMFEndpoint"</span>/&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;properties&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;max-streaming-clients&gt;<span style="color:#800000;color:#800000;">10</span>&lt;/max-streaming-clients&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/properties&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/channel-definition&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/162/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring ActionScript 0.7.1 Released</title>
		<link>http://www.herrodius.com/blog/161</link>
		<comments>http://www.herrodius.com/blog/161#comments</comments>
		<pubDate>Fri, 06 Feb 2009 08:38:50 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Air]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Spring ActionScript]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/161</guid>
		<description><![CDATA[Dear Community,
I'm pleased to announce that the Spring ActionScript 0.7.1 release is now available.
Download&#160;&#124;&#160;API Documentation&#160;&#124;&#160;Changelog
This is a minor release that fixes 2 blocking issues:
- import nodes were not parsed correctly, which resulted in the imported nodes not being created.
- circular reference error when 2 objects have bidirectional references.
We also added some extra classes to the [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Community,</p>
<p>I'm pleased to announce that the Spring ActionScript 0.7.1 release is now available.</p>
<p align='center'><a href="https://sourceforge.net/project/showfiles.php?group_id=194107&#038;package_id=306949">Download</a>&nbsp;|&nbsp;<a href="http://www.pranaframework.org/docs/0.7.1/api/">API Documentation</a>&nbsp;|&nbsp;<a href="http://www.pranaframework.org/docs/0.7.1/changelog.txt">Changelog</a></p>
<p>This is a minor release that fixes 2 blocking issues:<br />
- import nodes were not parsed correctly, which resulted in the imported nodes not being created.<br />
- circular reference error when 2 objects have bidirectional references.</p>
<p>We also added some extra classes to the domain package.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/161/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Spring ActionScript 0.7 Released</title>
		<link>http://www.herrodius.com/blog/160</link>
		<comments>http://www.herrodius.com/blog/160#comments</comments>
		<pubDate>Tue, 20 Jan 2009 16:10:06 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Spring ActionScript]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/160</guid>
		<description><![CDATA[Dear Community,
I'm pleased to announce that the Spring ActionScript 0.7 release is now available.
Download&#160;&#124;&#160;API Documentation&#160;&#124;&#160;Changelog
This is the first official release after switching from the Prana Framework to Spring ActionScript. Note that this release does not contain the Cairngorm and PureMVC extensions since these will later be released as separate extension libraries to the framework.
Some of [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Community,</p>
<p>I'm pleased to announce that the Spring ActionScript 0.7 release is now available.</p>
<p align='center'><a href="https://sourceforge.net/project/showfiles.php?group_id=194107&#038;package_id=306949">Download</a>&nbsp;|&nbsp;<a href="http://www.pranaframework.org/docs/0.7/api/">API Documentation</a>&nbsp;|&nbsp;<a href="http://www.pranaframework.org/docs/0.7/changelog.txt">Changelog</a></p>
<p>This is the first official release after switching from the Prana Framework to Spring ActionScript. Note that this release does not contain the Cairngorm and PureMVC extensions since these will later be released as separate extension libraries to the framework.</p>
<p>Some of the major changes and enhancements include:</p>
<p><strong>Reflection API is now AS3Reflect</strong></p>
<p>The reflection API is now provided as a separate project named AS3Reflect. This was a demand from several developers that wanted to use the reflection classes without having to use the whole Spring ActionScript codebase. For more info, please see <a href="http://code.google.com/p/as3reflect/">http://code.google.com/p/as3reflect/</a></p>
<p><strong>MVCS Support</strong></p>
<p>Inspired by the <a href="http://joeberkovitz.com/blog/reviewtube/">MVCS</a> principles that <a href="http://joeberkovitz.com/blog">Joe Berkovitz</a> describes, we created some experimental classes to support the MVCS workflow. Combining these principles with the IoC container of Spring ActionScript is actually very powerfull. Especially if you incorporate a presentation pattern like Presentation Model, you get maximum flexibility and simplicity by autowiring presentation models from the application context into the view layer of your application. I really recommend reading the MVCS and Presentation Model/Autowiring parts of a <a href="http://www.herrodius.com/blog/158">previous blog post</a> I wrote about this.</p>
<p><strong>IoC Container</strong></p>
<p>We have improved many things in the IoC container and added support for new things like parent and dependant objects. We will continue to improve the core container as we work towards a 1.0 release and will add support for new tags and attributes based on community feedback. So be sure to get in touch with and give us your feedback.</p>
<p>If you feel like helping us out, we could certainly use your help. This project is entirely created on a volunteer basis and in our spare (and limited) free time so needless to say that the more people, the faster we can deliver new releases and guarantee the quality of the framework. So if you think you have someting to offer, be it as a developer, tester, documentation writer, sample creator, ... please contact me or leave something in the comments. All help is more than welcome.</p>
<p>Enjoy this release and have fun coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/160/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Introducing AS3 Reflect</title>
		<link>http://www.herrodius.com/blog/159</link>
		<comments>http://www.herrodius.com/blog/159#comments</comments>
		<pubDate>Sat, 10 Jan 2009 15:44:02 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/159</guid>
		<description><![CDATA[As3reflect is a Reflection API written in ActionScript 3.0 and can be used for Flash/Flex/AIR and ActionScript projects. It is an intuïtive API on top of describeType() to give you runtime information of classes and instances. It also allows you to dynamically instantiate objects and invoke methods on existing objects.
This project consists of the reflection [...]]]></description>
			<content:encoded><![CDATA[<p>As3reflect is a Reflection API written in ActionScript 3.0 and can be used for Flash/Flex/AIR and ActionScript projects. It is an intuïtive API on top of describeType() to give you runtime information of classes and instances. It also allows you to dynamically instantiate objects and invoke methods on existing objects.</p>
<p>This project consists of the reflection classes already available in the Spring ActionScript framework which are now delivered as a separate swc library.</p>
<p>More information and a first release candidate for the 1.0 version can be found at <a href="http://code.google.com/p/as3reflect/">http://code.google.com/p/as3reflect/</a></p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/159/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spring ActionScript at FlexCamp 2008 Belgium</title>
		<link>http://www.herrodius.com/blog/158</link>
		<comments>http://www.herrodius.com/blog/158#comments</comments>
		<pubDate>Fri, 12 Dec 2008 10:18:31 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Spring ActionScript]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/158</guid>
		<description><![CDATA[Here's a rundown of the presentation I did on Spring ActionScript at the FlexCamp in Antwerp, Belgium. In 40 minutes I tried to cover the basic theory on Inversion of Control, Dependency Injection and the Spring ActionScript project in general. We then dove right into some code we've been writing for an enterprise app that [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a rundown of the presentation I did on Spring ActionScript at the FlexCamp in Antwerp, Belgium. In 40 minutes I tried to cover the basic theory on Inversion of Control, Dependency Injection and the Spring ActionScript project in general. We then dove right into some code we've been writing for an enterprise app that extensively uses Spring ActionScript's IoC container.</p>
<p><center>
<div style="width:425px;text-align:left" id="__ss_840353"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/herrodius/spring-actionscript-presentation?type=powerpoint" title="Spring ActionScript">Spring ActionScript</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=springactionscript-1229072979837175-2&#038;stripped_title=spring-actionscript-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=springactionscript-1229072979837175-2&#038;stripped_title=spring-actionscript-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" href="http://www.slideshare.net/herrodius/spring-actionscript-presentation?type=powerpoint" title="View Spring ActionScript on SlideShare">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/flash">flash</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/air">air</a>)</div>
</div>
<p></center></p>
<p>Since time was limited (or in case you were not there), I'll run through the key features of the code I ran through and try to give some more explanation.</p>
<p><strong>Targeting BlazeDS via remoting and messaging</strong></p>
<p>Whenever I'm hitting a backend, I try to have the endpoints externally configured. This allows me to switch between different endpoints - different test or production servers for instance - just by specifying the ip and port in an external properties file. This means that you don't have to specify any compiler arguments that point to the services-config.xml or messaging-config.xml files.</p>
<p>You can set up a channelset and a consumer with the following code. Notice the "method-invocation" element that allows you to execute a method on the object you create. This allows us to directly pass in a channel to the channelset. (In case you are interested, the method-invocation element is preprocessed to an instance of MethodInvokingFactoryObject)</p>
<div class="igBar"><span id="lcode-19"><a href="#" onclick="javascript:showPlainTxt('code-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-19">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"channelSet"</span> class=<span style="color:#CC0000;">"mx.messaging.ChannelSet"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;method-invocation name=<span style="color:#CC0000;">"addChannel"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;arg&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;object id=<span style="color:#CC0000;">"streamingAMFChannel"</span> class=<span style="color:#CC0000;">"mx.messaging.channels.StreamingAMFChannel"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"url"</span> value=<span style="color:#CC0000;">"http://${host}:${port}/${context-root}/messagebroker/streamingamf"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/object&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/arg&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/method-invocation&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/object&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"eventMessageFeedConsumer"</span> class=<span style="color:#CC0000;">"mx.messaging.Consumer"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"destination"</span> value=<span style="color:#CC0000;">"eventMessageFeed"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"channelSet"</span> ref=<span style="color:#CC0000;">"channelSet"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/object&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Have you noticed the placeholders "${...}" for the host, port and context-root? These are loaded from a properties file that is referenced in the application context file.</p>
<p>Here's the external properties file:</p>
<div class="igBar"><span id="lcode-20"><a href="#" onclick="javascript:showPlainTxt('code-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-20">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">host=<span style="color:#800000;color:#800000;">192</span>.<span style="color:#800000;color:#800000;">168</span>.<span style="color:#800000;color:#800000;">2</span>.<span style="color:#800000;color:#800000;">134</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">port=<span style="color:#800000;color:#800000;">8081</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">context-root=server-web </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And here's the import declaration in the application context xml file:</p>
<div class="igBar"><span id="lcode-21"><a href="#" onclick="javascript:showPlainTxt('code-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-21">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;property file=<span style="color:#CC0000;">"application-context.properties.txt"</span> /&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Of course, you can also specify remote objects in the application context. Here's an example:</p>
<div class="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"remoteObject"</span> class=<span style="color:#CC0000;">"mx.rpc.remoting.mxml.RemoteObject"</span> abstract=<span style="color:#CC0000;">"true"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"endpoint"</span> value=<span style="color:#CC0000;">"http://${host}:${port}/${context-root}/messagebroker/amf"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"showBusyCursor"</span> value=<span style="color:#CC0000;">"true"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/object&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"userRemoteObject"</span> parent=<span style="color:#CC0000;">"remoteObject"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"destination"</span> value=<span style="color:#CC0000;">"userService"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/object&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Notice that we actually split this up into 2 objects. The first object is an abstract remote object which we use as a parent object for concrete remote objects. Notice the "abstract=true" and the "parent=remoteObject" properties on these objects.</p>
<p><strong>MVCS support</strong></p>
<p>As part of the project we are working on, we also starting working on some experimental MVCS support. If you haven't heard of MVCS, be sure to check out at <a href="http://joeberkovitz.com/blog/reviewtube/">Joe Berkovitz' blog</a>.</p>
<p>What we provide so far are some interfaces and abstract base classes for services, operations and commands. Let's look at some code for services and operations.</p>
<p>Here's an interface for a user service, which defines a "getAll" method.</p>
<div class="igBar"><span id="lcode-23"><a href="#" onclick="javascript:showPlainTxt('code-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-23">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public interface IUserService <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; function getAll<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>:IAsyncOperation;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>We now want to create a concrete service for that interface. For instance, this could be a remote object enabled service. For that, we have a abstract remote object service base class.</p>
<div class="igBar"><span id="lcode-24"><a href="#" onclick="javascript:showPlainTxt('code-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-24">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public class UserRemoteObjectService extends AbstractRemoteObjectService implements IUserService <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function UserRemoteObjectService<span style="color:#006600; font-weight:bold;">&#40;</span>remoteObject:RemoteObject<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; super<span style="color:#006600; font-weight:bold;">&#40;</span>remoteObject<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function getAll<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>:IAsyncOperation <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var token:AsyncToken = remoteObject.<span style="">getAll</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; token.<span style="">addResponder</span><span style="color:#006600; font-weight:bold;">&#40;</span>new Responder<span style="color:#006600; font-weight:bold;">&#40;</span>onGetAllResult, onGetAllFault<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; return getOperation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"getAll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private function onGetAllResult<span style="color:#006600; font-weight:bold;">&#40;</span>event:ResultEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; getOperation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"getAll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">dispatchEvent</span><span style="color:#006600; font-weight:bold;">&#40;</span>new AsyncOperationResultEvent<span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">result</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private function onGetAllFault<span style="color:#006600; font-weight:bold;">&#40;</span>event:FaultEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; getOperation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"getAll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="">dispatchEvent</span><span style="color:#006600; font-weight:bold;">&#40;</span>new AsyncOperationErrorEvent<span style="color:#006600; font-weight:bold;">&#40;</span>event.<span style="">fault</span>.<span style="">faultDetail</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>For testing purposes, we could also create a mock user service:</p>
<div class="igBar"><span id="lcode-25"><a href="#" onclick="javascript:showPlainTxt('code-25'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-25">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public class UserMockService extends AbstractService implements IUserService <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private static var logger:ILogger = Log.<span style="">getLogger</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"UserMockService"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function UserMockService<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; logger.<span style="">warn</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"Mock user service instantiated."</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; public function getAll<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>:IAsyncOperation <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var users:ArrayCollection = new ArrayCollection<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var user1:User= new User<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; user1.<span style="">name</span> = <span style="color:#CC0000;">"John"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; users.<span style="">addItem</span><span style="color:#006600; font-weight:bold;">&#40;</span>user1<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var user2:User= new User<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; user2.<span style="">name</span> = <span style="color:#CC0000;">"Peter"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; users.<span style="">addItem</span><span style="color:#006600; font-weight:bold;">&#40;</span>user2<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; setTimeout<span style="color:#006600; font-weight:bold;">&#40;</span>onGetUsersResult, Math.<span style="">random</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>*<span style="color:#800000;color:#800000;">3000</span>, users<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CursorManager.<span style="">setBusyCursor</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; return getOperation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"getAll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; private function onGetUsersResult<span style="color:#006600; font-weight:bold;">&#40;</span>users:ArrayCollection<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var operation:IAsyncOperation = getOperation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"getAll"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; operation.<span style="">dispatchEvent</span><span style="color:#006600; font-weight:bold;">&#40;</span>new AsyncOperationResultEvent<span style="color:#006600; font-weight:bold;">&#40;</span>users<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; CursorManager.<span style="">removeBusyCursor</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>We can now define these objects in the application context as follows:</p>
<div class="igBar"><span id="lcode-26"><a href="#" onclick="javascript:showPlainTxt('code-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-26">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"userService"</span> class=<span style="color:#CC0000;">"UserMockService"</span>/&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">... <span style="">or</span> ...</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;object id=<span style="color:#CC0000;">"userService"</span> class=<span style="color:#CC0000;">"UserRemoteObjectService"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;constructor-arg&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;object id=<span style="color:#CC0000;">"userRemoteObject"</span> parent=<span style="color:#CC0000;">"remoteObject"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;property name=<span style="color:#CC0000;">"destination"</span> value=<span style="color:#CC0000;">"detectorGroupService"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/object&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/constructor-arg&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/object&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You can now use one of these implementations by calling the getAll() method. Make sure that you type the service to IUserService and not to a concrete implementation:</p>
<div class="igBar"><span id="lcode-27"><a href="#" onclick="javascript:showPlainTxt('code-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-27">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public function getUsers<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; var operation:IAsyncOperation = _userService.<span style="">getAll</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; operation.<span style="">addEventListener</span><span style="color:#006600; font-weight:bold;">&#40;</span>AsyncOperationEvent.<span style="">RESULT</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; function<span style="color:#006600; font-weight:bold;">&#40;</span>e:AsyncOperationResultEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logger.<span style="">info</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"Users loaded successfully."</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var users:ArrayCollection = ArrayCollection<span style="color:#006600; font-weight:bold;">&#40;</span>e.<span style="">result</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; operation.<span style="">addEventListener</span><span style="color:#006600; font-weight:bold;">&#40;</span>AsyncOperationEvent.<span style="">ERROR</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; function<span style="color:#006600; font-weight:bold;">&#40;</span>e:AsyncOperationErrorEvent<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; logger.<span style="">error</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"An error occurred when loading the users: "</span> + e.<span style="">fault</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>To implement your own services, you don't necessarely need to extend the AbstractService or AbstractRemoteObjectService class. These base classes just provide you with some convenient methods, like "getOperation" that creates a generic AsyncOperation for you.</p>
<p>You could of course also create an own implementation of the IAsyncOperation interface for your specific needs. For instance, you could create a GetAllUsersOperation that has all the logic for invoking a method on a remote object and that also deals with the result and fault handling of the remote call.</p>
<p><strong>Presentation Model and Autowiring</strong></p>
<p>I mentioned that we were using <a href="http://martinfowler.com/eaaDev/PresentationModel.html">Presentation Model</a> to seperate our UI state and logic from our views. This has worked surprisingly well for us and it certainly allows us to write better tests (for the presentation model). If you are new to Presentation Model and Presentation Patterns in general, I really recommend taking a look at the writings by <a href="http://martinfowler.com/eaaDev/">Martin Fowler</a> and <a href="http://weblogs.macromedia.com/paulw/">Paul Williams</a>.</p>
<p>Seperating logic and state from the view is one thing, but of course in order to use this combination you have to provide your view with an instance of a presentation model at some point. It's easy to read a presentation model from an application context, but injecting it is not that easy. Especially if your view component is nested a few levels deep inside other view components, it can be tricky to pass in the instance of the presentation model. We started of by passing in the presentation models from the root of the application through all components until we had finally reached the component that needed the presentation model. Needless to say that this approach required us to write a lot of extra code that really wasn't supposed to exist...</p>
<p>Enter custom metadata and SystemManager! Using the systemManager, you can listen to events that get fired when view components are added to the stage. This was exactly what we needed to know. Combined with a custom metadata element [Autowired], we now support dependencies being injected into views automatically.</p>
<p>Here's how it works. Suppose you have a UserPanel and a UserPanelPresentationModel. In you UserPanel you'll have a reference to that presentation model so you can actually use it in your view component. By adding the extra [Autowired] metadata you can mark a property (the presentation model) as a property that needs to be autowired when the view is created and added to the stage.</p>
<p>In your UserPanel.mxml file, you declare the presentation model as follows.</p>
<div class="igBar"><span id="lcode-28"><a href="#" onclick="javascript:showPlainTxt('code-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-28">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>Bindable<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>Autowired<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public var presentationModel:UserPanelPresentationModel; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Now all we need to do is listen to the ADDED event on the systemManager and write some glue code that injects the presentation models defined in the application context into the view components. This code goes in your main application file.</p>
<div class="igBar"><span id="lcode-29"><a href="#" onclick="javascript:showPlainTxt('code-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-29">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import mx.<span style="">utils</span>.<span style="">DescribeTypeCache</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">import mx.<span style="">utils</span>.<span style="">DescribeTypeCacheRecord</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">systemManager</span>.<span style="">addEventListener</span><span style="color:#006600; font-weight:bold;">&#40;</span>Event.<span style="">ADDED</span>, onAdded<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">...</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="">private</span> function onAdded<span style="color:#006600; font-weight:bold;">&#40;</span>event:Event<span style="color:#006600; font-weight:bold;">&#41;</span>:void <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; var autowiredObject:Object = event.<span style="">target</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; var typeInfo:DescribeTypeCacheRecord = DescribeTypeCache.<span style="">describeType</span><span style="color:#006600; font-weight:bold;">&#40;</span>autowiredObject<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; for each <span style="color:#006600; font-weight:bold;">&#40;</span>var metaDataNode:XML in typeInfo.<span style="">typeDescription</span>..<span style="">metadata</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>metaDataNode.<span style="">attribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"name"</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC0000;">"Autowired"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; var propertyNode:XML = metaDataNode.<span style="">parent</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; var property:String = propertyNode.@name.<span style="">toString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; var objectName:String = property;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; var autowireByType:Boolean = true;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; for each <span style="color:#006600; font-weight:bold;">&#40;</span>var arg:XML in metaDataNode.<span style="">arg</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>arg.<span style="">attribute</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0000;">"value"</span><span style="color:#006600; font-weight:bold;">&#41;</span> == <span style="color:#CC0000;">"byName"</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; autowireByType = false;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>autowireByType<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var clazz:Class = ClassUtils.<span style="">forName</span><span style="color:#006600; font-weight:bold;">&#40;</span>propertyNode.@type.<span style="">toString</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; var objectNames:Array = m_applicationContext.<span style="">getObjectNamesForType</span><span style="color:#006600; font-weight:bold;">&#40;</span>clazz<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; if <span style="color:#006600; font-weight:bold;">&#40;</span>objectNames.<span style="">length</span> == <span style="color:#800000;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; objectName = objectNames<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#800000;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; autowiredObject<span style="color:#006600; font-weight:bold;">&#91;</span>property<span style="color:#006600; font-weight:bold;">&#93;</span> = m_applicationContext.<span style="">getObject</span><span style="color:#006600; font-weight:bold;">&#40;</span>objectName<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You may have noticed that we do some extra checks on the attributes of the Autowired metadata. This is because the code above support autowiring by type (the default) and autowiring by name. Autowiring by type means that we will look in the context for objects that are of a certain type. If we find one, we will inject it. Autowiring by name means that we will look for objects in the context that have a certain id.</p>
<p>You can set up autowiring by name as follows:</p>
<div class="igBar"><span id="lcode-30"><a href="#" onclick="javascript:showPlainTxt('code-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-30">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>Bindable<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>Autowired<span style="color:#006600; font-weight:bold;">&#40;</span>mode=<span style="color:#CC0000;">"byName"</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public var presentationModel:UserPanelPresentationModel; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Conclusion</strong></p>
<p>I hope you now got a good understanding of some of the key features, best practices and what we are doing with Spring ActionScript in general. Don't hesitate to join our forum or the team if you want to help us out. We are really looking for more people to join, especially for working on samples and documentation.</p>
<p><a href="http://forum.springframework.org/forumdisplay.php?f=60"><br />
http://forum.springframework.org/forumdisplay.php?f=60</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/158/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Prana goes Spring: Introducing Spring ActionScript</title>
		<link>http://www.herrodius.com/blog/157</link>
		<comments>http://www.herrodius.com/blog/157#comments</comments>
		<pubDate>Wed, 03 Dec 2008 20:43:17 +0000</pubDate>
		<dc:creator>Christophe</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Inversion of Control]]></category>
		<category><![CDATA[Prana]]></category>
		<category><![CDATA[Spring ActionScript]]></category>

		<guid isPermaLink="false">http://www.herrodius.com/blog/157</guid>
		<description><![CDATA[Dear community,
I'm pleased to introduce a new Spring extension called Spring ActionScript. This extension, formerly known as the Prana Framework, is aimed at bringing Inversion of Control to ActionScript along with several other interesting utilities. 
The extension is written in ActionScript 3 and is targeted at Flex, AIR and Flash developers. The IoC container and [...]]]></description>
			<content:encoded><![CDATA[<p>Dear community,</p>
<p>I'm pleased to introduce a new Spring extension called Spring ActionScript. This extension, formerly known as the Prana Framework, is aimed at bringing Inversion of Control to ActionScript along with several other interesting utilities. </p>
<p>The extension is written in ActionScript 3 and is targeted at Flex, AIR and Flash developers. The IoC container and its XML dialect is heavily influenced by that of Spring so it should be easy for developers familiar with Spring to get started with it.</p>
<p>Spring ActionScript contains the following features:<br />
* Inversion of Control container - XML driven, based on Spring<br />
* Reflection API - providing a decent API around describeType()<br />
* Cairngorm extensions - configurable Service Locator, extended Front Controller with command factories, Command chaining, ...<br />
* PureMVC extensions - bringing Dependency Injection to PureMVC<br />
* several utilities, assertions, etc</p>
<p>We are also working on the following features, all of which are in an experimental phase:<br />
* MVCS support - providing an architectural framework based on Model-View-Controller-Service<br />
* Domain Driven Design utilities - base classes for entities, value objects, enums, repositories and services<br />
* SqlLite database templates<br />
* Aspect Oriented Programming</p>
<p>The project is currently incubated as we work towards a 1.0 release. The latest available (Prana) release is 0.6 and we plan to release a 0.6.1 version in the coming weeks that introduces the switch to Spring ActionScript.</p>
<p>For more info, please see the following links:</p>
<p>* SVN - <a href="https://src.springframework.org/svn/se-springactionscript-as">https://src.springframework.org/svn/se-springactionscript-as</a><br />
* FishEye - <a href="https://fisheye.springframework.org/browse/se-springactionscript-as">https://fisheye.springframework.org/browse/se-springactionscript-as</a><br />
* JIRA: <a href="http://jira.springframework.org/browse/SESPRINGACTIONSCRIPTAS">http://jira.springframework.org/browse/SESPRINGACTIONSCRIPTAS</a><br />
* Forum: <a href="http://forum.springframework.org/forumdisplay.php?f=60">http://forum.springframework.org/forumdisplay.php?f=60</a></p>
<p>Thanks to SpringSource and everyone involved in making this happen!</p>
<p>Hope you enjoy this extension!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herrodius.com/blog/157/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
