<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8263529019533665919</id><updated>2011-12-15T16:43:24.213-08:00</updated><category term='spring actionscript'/><category term='v2.0'/><category term='flex XML bug whitespace'/><category term='flex actionscript undo history opensource'/><category term='flex actionscript undo history'/><category term='actionscript IoC Spring release library'/><category term='report'/><category term='spring actionscript include class compile'/><category term='progress'/><category term='spring actionscript cairngorm flex convention based programming'/><category term='actionscript as3commons bytecode AOP proxy'/><category term='spring actionscript release'/><title type='text'>I code therefore I... blog?</title><subtitle type='html'>I'm a dutch geek who lives in Brussels. My main coding tasks revolve around Adobe Flex these days, but next to that I'm an avid fan of all things .NET and database related. I'm going to use this blog for random programming thoughts and the release of small open-source projects.
I'm a Spring Actionscript developer as well, so quite a lot of my posts will be related to that.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-8572846446219029554</id><published>2011-12-13T11:38:00.000-08:00</published><updated>2011-12-13T11:38:56.406-08:00</updated><title type='text'>Spring Actionscript 2.0 Progress Report - Part V</title><content type='html'>Its been quite a while since the last progress report, I'm sorry to admit that I haven't been able to spend as much time working on Spring Actionscript 2.0 as I had hoped. Sadly, work and life in general got in the way.&lt;br /&gt;Nevertheless there have been some exciting changes to the code base. Not a lot of extra features, but more a refinement of the existing stuff.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Multiple root views&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An application context used to be only tied to one root view. I was, wrongfully, under the impression that a context will always be wiring one module or sub application.&lt;br /&gt;Until I ran into a situation during my own current project where a tab navigator was managed by a parent context with child contexts managing the actual screens in each tab. Only it was possible for multiple tabs to be managed by the same child context.&lt;br /&gt;So, to support this the application context now receives an optional Vector of DisplayObjects as a constructor parameter. After context creation its also to possible to add root views at runtime using the new &lt;i&gt;addRootView()&lt;/i&gt; method on the application context. So the views do not necessarily need to be known at the time of creation of the context.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;MXMLApplicationContext cleaned up&lt;/span&gt;&lt;br /&gt;Admittedly, the MXMLApplicationContext had turned into a bit of a mess. The MXML component acted as a sort of wrapper for an internal DefaultApplicationContext, which somehow seemed like a good idea at the time but lead to nasty issues in practice. (Thanks to this forum post I realized the error of my ways: &lt;a href="http://forum.springsource.org/showthread.php?119128-Hi-Does-Spring-AS-2-0-support-multi-module-now-or-maybe-this-fp-on-schedule&amp;amp;s=5e7a22928307ff7f7b105dafec914c2c" target="_blank"&gt;Spring Actionscript forum link&lt;/a&gt;)&lt;br /&gt;So, the MXMLApplicationContext got refactored heavily and while fine-tuning the multi-module support I added some nifty extra possibilities for child contexts.&lt;br /&gt;Originally, as described in &lt;a href="http://zwaga.blogspot.com/2011/09/spring-actionscript-v20-progress-report.html" target="_blank"&gt;Progress Report Part III&lt;/a&gt;, the &lt;i&gt;addChildContext()&lt;/i&gt; method signature looked like this:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;function addChildContext(childContext:IApplicationContext, shareDefinitions:Boolean=true, shareSingletons:Boolean=true, shareEventBus:Boolean=true):void; &lt;/blockquote&gt;This now has changed to a slightly more readable form:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;function addChildContext(childContext:IApplicationContext, settings:ContextShareSettings=null):IApplicationContext;&lt;/blockquote&gt;As you'll see the most interesting parameter here is the one called &lt;i&gt;settings&lt;/i&gt;. This parameter is of type ContextShareSettings and this can describe the various ways that a parent context will share its data with a child context. This class has four properties:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;i&gt;shareDefinitions&lt;/i&gt; - If true all definitions that do not have their childContextAccess set to NONE or SINGLETON will be cloned and added to the child context.&lt;/li&gt;&lt;li&gt;&lt;i&gt;shareProperties&lt;/i&gt; - If true all the external properties will be added to the child context&lt;/li&gt;&lt;li&gt;&lt;i&gt;shareSingletons &lt;/i&gt;- If &lt;span class="bold"&gt;&lt;strong&gt;true&lt;/strong&gt;&lt;/span&gt; all of the       singletons in the parent's cache will be added to the child's cache,       provided that an object with the same name doesn't already exist in the       child context. Using this also explicitly added singleton can be shared (an explicit singleton means a cached object that doesn't have a corresponding object definition)&lt;/li&gt;&lt;li&gt;&lt;i&gt;eventBusShareSettings &lt;/i&gt;- This property is of type EventBusShareSettings, which describes the way that the context eventbuses will be linked to each other.&lt;/li&gt;&lt;/ol&gt;An EventBusShareSettings instance has these properties:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;i&gt;shareRegularEvents &lt;/i&gt;- If true, all regular events, so events that are dispatched without a topic will be shared.&lt;/li&gt;&lt;li&gt;&lt;i&gt;sharedTopics &lt;/i&gt;- A Vector of topics whose events will be shared.&lt;/li&gt;&lt;li&gt;&lt;i&gt;shareKind &lt;/i&gt;- This property is of type EventBusShareKind as described below.&lt;/li&gt;&lt;/ol&gt;The&amp;nbsp; EventBusShareKind enumeration has these values:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;NONE - The eventbuses will not be connected.&lt;/li&gt;&lt;li&gt;BOTH_WAYS - Events dispatched by the parent will be routed to the child's eventbus, and vice versa, events dispatched by the child will be routed to the parent.&lt;/li&gt;&lt;li&gt;CHILD_LISTENS_TO_PARENT - Events dispatched by the parent will be routed to the child's eventbus.&lt;/li&gt;&lt;li&gt;PARENT_LISTENS_TO_CHILD - Events dispatched by the child will be routed to the parent's eventbus.&lt;/li&gt;&lt;/ul&gt;Some events were added to this process as well, the application context now dispatches four types of ChildContextEvents:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;AFTER_CHILD_CONTEXT_REMOVE&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;BEFORE_CHILD_CONTEXT_REMOVE&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;BEFORE_CHILD_CONTEXT_ADD&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;AFTER_CHILD_CONTEXT_ADD&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;The names speak for themselves, but the most interesting ones are the &lt;b&gt;BEFORE_CHILD_CONTEXT_ADD&lt;/b&gt; and &lt;b&gt;BEFORE_CHILD_CONTEXT_REMOVE&lt;/b&gt;.&lt;br /&gt;These events are cancelable, so when &lt;i&gt;preventDefault()&lt;/i&gt; is called on them the specified logic will not be executed. So in these cases the child will not be added, or not removed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Multi-module support and automatic child context detection&lt;/span&gt;&lt;br /&gt;The Flex extensions for Spring Actionscript have been further fleshed out in the multi-module support department.&lt;br /&gt;The MXMLApplicationContext has a new property called &lt;i&gt;modulePolicy&lt;/i&gt; that determines what a context will do when it encounters a Flex module on the stage. This &lt;i&gt;modulePolicy&lt;/i&gt; is an enum with two values:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;AUTOWIRE - Try to autowire the module&lt;/li&gt;&lt;li&gt;IGNORE - Do nothing&lt;/li&gt;&lt;/ul&gt;By default this property has a value of &lt;b&gt;ModulePolicy.AUTOWIRE&lt;/b&gt;, so if your application just needs one context and configuration, but loads its UI in parts there is nothing to be changed. Just add an MXMLApplicationContext and you're good to go.&lt;br /&gt; However, when modules are loaded with their own context that is responsible for wiring the module, set this property to &lt;b&gt;ModulePolicy.IGNORE&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Also new in this drop of Spring Actionscript 2.0 is the fact that MXML based contexts now automatically can detect the creation of child contexts. So all that is needed is to add a context to your module and things will get sorted automatically.&lt;br /&gt;When a new context is detected it will be automatically added to the parent context. The way that an application context determines whether it is a parent context or a child context is by checking the systemManager's &lt;i&gt;isTopLevelRoot &lt;/i&gt;property of one of its root views. If this property is &lt;b&gt;true&lt;/b&gt; then it assumes its the parent, if not, it assumes its a child.&lt;br /&gt;When a parent adds the child it, naturally, invokes its own &lt;i&gt;addChildContext()&lt;/i&gt; method. To specify the ContextShareSettings instance for this call it is possible to do so using the defaultShareSettings property on the MXMLApplicationContext.&lt;br /&gt;&lt;br /&gt;If different settings are needed for different childcontexts there is the ChildContextEvents, when listening for the &lt;b&gt;BEFORE_CHILD_CONTEXT_ADD&lt;/b&gt; event it is possible to assign a ContextShareSettings instance to the &lt;i&gt;ChildContextEvent.shareSettings&lt;/i&gt; property,&lt;br /&gt;If the ContextShareSettings instance is not capable of describing the way that the contexts ought to be shared there is event the possibility to completely override the sharing logic.&lt;br /&gt;This is done by assigning a Function to the &lt;i&gt;ChildContextEvent.customAddChildFunction&lt;/i&gt; property, this function needs to have this signature:&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;pre class="programlisting" style="font-family: inherit;"&gt;function(parentContext:IApplicationContext, childContext:IApplicationContext, settings:ContextShareSettings);&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&amp;nbsp;A sample application that demonstrates the functionality described above here can be viewed here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://beta.springactionscript.org/samples/cafe-townsend-multi-module/Main.html" target="_blank"&gt;Cafe Townsend - Multi-module implementation&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The application has 'view source' enabled so its implementation can be checked out easily.&lt;br /&gt;&lt;br /&gt;Oh, and before I forget, this functionality can be turned off completely by setting the &lt;i&gt;autoAddChildren&lt;/i&gt; property on the MXML context to &lt;b&gt;false&lt;/b&gt;. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Popup and tooltip wiring&lt;/span&gt;&lt;br /&gt;The MXML based contexts are now able to automatically detect popups and tooltips for wiring purposes. So it is no longer necessary to register a popup after creation, it is automatically picked by the regular stagewiring.&lt;br /&gt;There was some dirty hacking needed to get this working, if you're interested in the nasty details, then check out the &lt;a href="https://fisheye.springsource.org/browse/se-springactionscript-as/branches/2.0/spring-actionscript-core/src/main/actionscript/org/springextensions/actionscript/stage/PopupAndTooltipWireManager.as?hb=true" target="_blank"&gt;PopupAndTooltipWireManager&lt;/a&gt; class.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;Logging&lt;/span&gt;&lt;br /&gt;The framework now reports its internal behavior much more elaborately than before, its not completely finished yet, but there is already an enormous slew of statements waiting for you to be checked out.&lt;br /&gt;Internally we use the mighty &lt;a href="http://www.as3commons.org/as3-commons-logging/index.html" target="_blank"&gt;as3commons-logging&lt;/a&gt; library by Martin Heidegger which, as it should, is turned off by default.&lt;br /&gt;To see the log statements turn up in your trace log all you need to do is add this line of code before the context gets initialized:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;&lt;pre&gt;&lt;span class="ActionScriptDefault_Text"&gt;LOGGER_FACTORY&lt;/span&gt;&lt;span class="ActionScriptOperator"&gt;.&lt;/span&gt;&lt;span class="ActionScriptDefault_Text"&gt;setup&lt;/span&gt; &lt;span class="ActionScriptOperator"&gt;=&lt;/span&gt; &lt;span class="ActionScriptReserved"&gt;new&lt;/span&gt; &lt;span class="ActionScriptDefault_Text"&gt;SimpleTargetSetup&lt;/span&gt;&lt;span class="ActionScriptBracket/Brace"&gt;(&lt;/span&gt;&lt;span class="ActionScriptReserved"&gt;new&lt;/span&gt; &lt;span class="ActionScriptDefault_Text"&gt;TraceTarget&lt;/span&gt;&lt;span class="ActionScriptBracket/Brace"&gt;(&lt;/span&gt;&lt;span class="ActionScriptBracket/Brace"&gt;)&lt;/span&gt;&lt;span class="ActionScriptBracket/Brace"&gt;)&lt;/span&gt;;&lt;/pre&gt;&lt;/blockquote&gt;&amp;nbsp;(Don't forget to add the as3commons-logging .swc to your project of course)&lt;br /&gt;The as3commons-logging library offers a host of other logging targets as well, check out its documentation for more details on that.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;In conclusion&lt;/span&gt;&lt;br /&gt;The documentation has been added to steadily, you can check this out at the usual location:&lt;br /&gt;&lt;a href="http://beta.springactionscript.org/docs/reference/html/index.html" target="_blank"&gt;Spring Actionscript 2.0 - Beta docs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;New snapshots have been deployed to the maven repository, so using the 2.0-SNAPSHOT artifact will get updated automatically, should you be using that.&lt;br /&gt;&lt;br /&gt;If you have any questions or suggestions, check out the user forums:&lt;br /&gt;&lt;a href="http://forum.springsource.org/forumdisplay.php?60-Spring-Actionscript" target="_blank"&gt;Spring Actionscript forum&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can follow me on twitter: &lt;a href="https://twitter.com/#%21/@mechhead" target="_blank"&gt;@mechhead&lt;/a&gt;&lt;br /&gt;Or follow Spring Actionscript: &lt;a href="https://twitter.com/#%21/@springas" target="_blank"&gt;@springas&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Our JIRA bugbase can be reached here:&lt;br /&gt;&lt;a href="https://jira.springsource.org/browse/SESPRINGACTIONSCRIPTAS" target="_blank"&gt;SpringSource JIRA&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks for taking the time again to plow through this pile of text, until next time, happy coding!&lt;br /&gt;&lt;br /&gt;Roland&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-8572846446219029554?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/8572846446219029554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/12/spring-actionscript-20-progress-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/8572846446219029554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/8572846446219029554'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/12/spring-actionscript-20-progress-report.html' title='Spring Actionscript 2.0 Progress Report - Part V'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-648177314683135789</id><published>2011-09-19T13:06:00.000-07:00</published><updated>2011-09-19T13:07:49.797-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='progress'/><category scheme='http://www.blogger.com/atom/ns#' term='v2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript'/><category scheme='http://www.blogger.com/atom/ns#' term='report'/><title type='text'>Spring Actionscript v2.0 Progress Report - part IV</title><content type='html'>So, after the release of as3commons-bytecode v1.0 (by the way, v1.1 is nearing completion already hehe), it was time to focus back on Spring Actionscript v2.0&lt;br /&gt;&lt;br /&gt;I've been mostly busy re-setting up the site generation. We are building our documentation in the &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/DocBook"&gt;Docbook&lt;/a&gt; format. Its has a bit of a learning curve, but once you get the hang of it, and especially the extension points of the transformation classes, &lt;a href="http://www.docbook.org/"&gt;Docbook&lt;/a&gt; is a great choice to encode technical documentation in. For me it was important to be able to simply enclose a class name with a &amp;lt;literal/&amp;gt; element and have a custom XSLT sheet transform this to a &amp;lt;a href="..."&amp;gt;Classname&amp;lt;/a&amp;gt; result. With the href containing a valid link to the correct ASDoc page.&lt;br /&gt;Luckily the intermittent XML format that is being spat out by the ASDoc compiler helps out here, so that saves me quite a bit of typing. We used to already have a system in place but this still required me to copy/paste the fully qualified into an &lt;b&gt;xlink:href&lt;/b&gt; attribute. Which sucks if you have hundreds of class names strewn throughout the reference docs. But now that pain is gone :)&lt;br /&gt;&lt;br /&gt;Anyways, once that was out of the way I added some custom &lt;a href="http://sourceforge.net/apps/mediawiki/xslthl/index.php?title=Main_Page"&gt;xslthl&lt;/a&gt; extensions, so now we have some nicely highlighted code snippets as well.&lt;br /&gt;&lt;br /&gt;And then the writing started... I've tried to re-organize the old reference docs into something with a little bit better of an overview. I hope I've succeeded...&lt;br /&gt;&lt;br /&gt;But besides writing documentation there *have* been some small additions to the library since the last progress report. Let's see what they are.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;MXML EventBus Custom Configuration&lt;/h2&gt;For XML configuration we described the Eventbus namespace handler to easily configure eventhandlers, interceptor, listenerinterceptors and event routers in the second progress report. In the third one we described the ICustomObjectDefinitionComponentinterface.&lt;br /&gt;Using this interface we now offer some Eventbus configuration extensions for the MXML configuration.&lt;br /&gt;So, to configure an Eventhandler in MXML use this MXML markup in your configuration:&lt;br /&gt;&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventHandler&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"metadataHandler"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventHandlerMethod&lt;/span&gt; name=&lt;span style="color: red;"&gt;"handleEvent"&lt;/span&gt; eventName=&lt;span style="color: red;"&gt;"complete"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventHandler&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Where &lt;b&gt;instance&lt;/b&gt; is the object name whose &lt;b&gt;handleEvent&lt;/b&gt; method will be used as the &lt;b&gt;eventhandler&lt;/b&gt; for events with the name &lt;b&gt;complete&lt;/b&gt;.&lt;br /&gt;To add a topic or topics, use the topics property:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventHandler&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"metadataHandler"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventHandlerMethod&lt;/span&gt; name=&lt;span style="color: red;"&gt;"handleEvent"&lt;/span&gt; eventName=&lt;span style="color: red;"&gt;"complete"&lt;/span&gt; topics=&lt;span style="color: red;"&gt;"topic1,topic2"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventHandler&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;For an event interceptor, add this MXML markup:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventInterceptor&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"eventInterceptor"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:InterceptionConfiguration&lt;/span&gt; eventName=&lt;span style="color: red;"&gt;"complete"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventInterceptor&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;Same applies here for topics, or topic properties, or if you want to intercept an event class instead of an event by name:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventInterceptor&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"eventInterceptor"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:InterceptionConfiguration&lt;/span&gt; eventClass=&lt;span style="color: red;"&gt;"{MyCustomEvent}"&lt;/span&gt; topics=&lt;span style="color: red;"&gt;"topic1"&lt;/span&gt; topicProperties=&lt;span style="color: red;"&gt;"myProperty,myOtherProperty"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventInterceptor&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;And event listener interceptor is almost the same as an interceptor, configuration-wise:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventListenerInterceptor&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"eventListenerInterceptor"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:InterceptionConfiguration&lt;/span&gt; eventName=&lt;span style="color: red;"&gt;"complete"&lt;/span&gt; topics=&lt;span style="color: red;"&gt;"topic1"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventListenerInterceptor&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;And lastly, there is the RouteEvents markup, used to automatically send one or more specified events dispatched by a specified object through the EventBus. To configure this in MXML, use this markup:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventRouter&lt;/span&gt; instance=&lt;span style="color: red;"&gt;"eventRouterInstance"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:EventRouterConfiguration&lt;/span&gt; eventNames=&lt;span style="color: red;"&gt;"busy,progress,ready"&lt;/span&gt; topics=&lt;span style="color: red;"&gt;"topic1"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;/sas:EventRouter&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;And that's it!&lt;br /&gt;&lt;h2&gt;Factory objects&lt;/h2&gt;Spring Actionscript v1.x offered the &lt;i&gt;IFactoryObject &lt;/i&gt;to perform complex object creation and configuration for cases where XML or MXML markup was simply to verbose or unwieldy. Now Spring Actionscript v2.0 doesn't require you to implement the interface any more, you can simply add this metadata to your class:&lt;br /&gt;&lt;div class="actionscript3" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;Factory&lt;span style="color: black;"&gt;(&lt;/span&gt;factoryMethod=&lt;span style="color: #990000;"&gt;"createNewInstance"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0033ff; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #9900cc; font-weight: bold;"&gt;class&lt;/span&gt; IncrediblyComplicatedObjectFactoryThatDoesNotImplementIFactoryObject &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #0033ff; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #339966; font-weight: bold;"&gt;function&lt;/span&gt; createNewInstance&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;:*&lt;/span&gt; &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #6699cc; font-weight: bold;"&gt;var&lt;/span&gt; instance&lt;span style="color: #000066; font-weight: bold;"&gt;:&lt;/span&gt;IncrediblyComplicatedObject = &lt;span style="color: #0033ff; font-weight: bold;"&gt;new&lt;/span&gt; IncrediblyComplicatedObject&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #009900; font-style: italic;"&gt;//creation logic ommitted&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: #0033ff; font-weight: bold;"&gt;return&lt;/span&gt; instance&lt;span style="color: #000066; font-weight: bold;"&gt;;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Now all you have to do is add this class as an object definition to your configuration and it'll be automatically picked as a factory object by the container.&lt;br /&gt;&lt;br /&gt;If you don't want to litter your classes with metadata, you can also use the XML configuration, to achieve this, first add the util namespace handler to your &lt;i&gt;XMLApplicationContext&lt;/i&gt;:&lt;br /&gt;&lt;br /&gt;&lt;div class="actionscript3" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;xmlApplicationContext&lt;span style="color: #000066; font-weight: bold;"&gt;.&lt;/span&gt;addNamespaceHandler&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #0033ff; font-weight: bold;"&gt;new&lt;/span&gt; UtilNamespaceHandler&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Then add this namespace to your XML configuration:&lt;br /&gt;&lt;div class="xml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;xmlns:util='http://www.springactionscript.org/schema/util'&lt;/div&gt;&lt;br /&gt;And finally, add this markup to the XML itself:&lt;br /&gt;&lt;div class="xml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: #009900;"&gt;&lt;span style="color: black; font-weight: bold;"&gt;&amp;lt;util:factory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #000066;"&gt;factory-method&lt;/span&gt;=&lt;span style="color: red;"&gt;"createNewInstance"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #000066;"&gt;class&lt;/span&gt;=&lt;span style="color: red;"&gt;"com.myclasses.factories.IncrediblyComplicatedObjectFactoryThatDoesNotImplementIFactoryObject"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #009900;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #000066;"&gt;id&lt;/span&gt;=&lt;span style="color: red;"&gt;"incrediblyComplicatedObject"&lt;/span&gt;&lt;span style="color: black; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Naturally, there is also the possibility to do the same in MXML configuration, use this MXML markup instead:&lt;br /&gt;&lt;div class="mxml" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #7400ff;"&gt;&amp;lt;sas:FactorObjectDefinition&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; factoryMethod=&lt;span style="color: red;"&gt;"createNewInstance"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; clazz=&lt;span style="color: red;"&gt;"{IncrediblyComplicatedObjectFactoryThatDoesNotImplementIFactoryObject}"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; id=&lt;span style="color: red;"&gt;"incrediblyComplicatedObject"&lt;/span&gt;&lt;span style="color: #7400ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;Metadata configuration&lt;/h2&gt;One of the disadvantages of the metadata configuration used to be that you can only add the &lt;b&gt;[Component]&lt;/b&gt; metadata to classes that you have source code access to. It was impossible to add object definitions for Flex classes, or any other third party libraries for that matter.&lt;br /&gt;Or maybe you simply dislike having all of the &lt;b&gt;[Component]&lt;/b&gt; metadata strewn around your code base. Certainly in larger projects this might become a handicap.&lt;br /&gt;Therefore I have added the &lt;b&gt;[Configuration]&lt;/b&gt; metadata tag. This can be added to a class that functions as nothing more than a placeholder for object definition specific metadata.&lt;br /&gt;&lt;br /&gt;Here's an example of what this class might look like:&lt;br /&gt;&lt;div class="actionscript3" style="background-color: #f0f0f0; border: 1px solid #d0d0d0; color: #000066; font-family: monospace;"&gt;&lt;span style="color: black;"&gt;[&lt;/span&gt;Configuration&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0033ff; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #9900cc; font-weight: bold;"&gt;class&lt;/span&gt; MyConfiguration &lt;span style="color: black;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;Constructor&lt;span style="color: black;"&gt;(&lt;/span&gt;args=&lt;span style="color: #990000;"&gt;"ref=objectName2"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;Invoke&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #004993;"&gt;name&lt;/span&gt;=&lt;span style="color: #990000;"&gt;"someMethodName"&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;,&lt;/span&gt;args=&lt;span style="color: #990000;"&gt;"ref=objectName1, value=10"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;Property&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #004993;"&gt;name&lt;/span&gt;=&lt;span style="color: #990000;"&gt;"wireOnlyOnce"&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;,&lt;/span&gt;&lt;span style="color: #004993;"&gt;value&lt;/span&gt;=&lt;span style="color: #990000;"&gt;"true"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: black;"&gt;[&lt;/span&gt;Component&lt;span style="color: black;"&gt;(&lt;/span&gt;id=&lt;span style="color: #990000;"&gt;"processor"&lt;/span&gt;&lt;span style="color: #000066; font-weight: bold;"&gt;,&lt;/span&gt;isLazyInit=&lt;span style="color: #990000;"&gt;"true"&lt;/span&gt;&lt;span style="color: black;"&gt;)&lt;/span&gt;&lt;span style="color: black;"&gt;]&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #0033ff; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #6699cc; font-weight: bold;"&gt;var&lt;/span&gt; defaultAutowiringStageProcessor&lt;span style="color: #000066; font-weight: bold;"&gt;:&lt;/span&gt;DefaultAutowiringStageProcessor&lt;span style="color: #000066; font-weight: bold;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;What this does is add an object definition for the class &lt;i&gt;DefaultAutowiringStageProcessor&lt;/i&gt;, with object name '&lt;b&gt;processor&lt;/b&gt;'. It will inject the object with name &lt;b&gt;objectName2 &lt;/b&gt;into its constructor, it will set its wireOnlyOnce property to &lt;b&gt;true&lt;/b&gt;, it will invoke it &lt;b&gt;someMethodName &lt;/b&gt;with two arguments: an instance of the object with name &lt;b&gt;objectName1 &lt;/b&gt;and a value of &lt;b&gt;10&lt;/b&gt;. And finally, it will set is &lt;b&gt;lazyInit &lt;/b&gt;property to &lt;b&gt;true&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Just make sure that this class will get compiled into your resulting SWF by declaring it somewhere, otherwise the MetadataApplicationContext won't be able to detect it.&lt;br /&gt;&lt;br /&gt;There will be an extension point for this as well, to be able to add custom metadata to these configurations that can add extra configuration logic to specific object definitions. But that is for the next progress report :)&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Beta site is online!&lt;/h1&gt;And finally I am happy to annoucne that the beta site for Spring Actionscript v2.0 is now online! As you will see the reference documentation is far from complete. This is &lt;i&gt;VERY&lt;/i&gt; much a work in progress, but as I mention this is a &lt;i&gt;BETA&lt;/i&gt; site, with &lt;i&gt;BETA&lt;/i&gt; software. So bear with me :)&lt;br /&gt;&lt;br /&gt;So please, anything you download from there, please do not be surprised if it crashes, explodes or doesn't work like it says on the box. &lt;b&gt;Do&lt;/b&gt; however play around with it, poke holes in it, and contact us with questions, suggestions, criticism and ideas.&lt;br /&gt;&lt;br /&gt;You can find the beta site at this address: &lt;a href="http://beta.springactionscript.org/"&gt;http://beta.springactionscript.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I believe that's it for now, until the next time, happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-648177314683135789?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/648177314683135789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/09/spring-actionscript-v20-progress-report_19.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/648177314683135789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/648177314683135789'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/09/spring-actionscript-v20-progress-report_19.html' title='Spring Actionscript v2.0 Progress Report - part IV'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-5800612887935856911</id><published>2011-09-14T04:51:00.000-07:00</published><updated>2011-09-14T04:52:51.850-07:00</updated><title type='text'>Released: AS3Commons-Bytecode version 1.0!</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;So, its been more than a year in the making. If I check the changelog, the first commit of as3commons-bytecode was done at the 27th of June 2010.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="http://www.as3commons.org/as3-commons-bytecode/index.html"&gt;http://www.as3commons.org/as3-commons-bytecode/index.html&lt;/a&gt; &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;I've decided to call this release v1.0. I could think of another thousand things to be tweaked and improved but at a certain moment there needs to be a first final release :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;This certainly doesn't mean the library is now finished, I will keep on tweaking and improving the library. Hopefully users of the library will join in the discussion and suggest new features or improvements.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;So, now perhaps is the time to look back, reflect and tell a little about the history of as3commons-bytecode :) &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;I started as3commons-bytecode after taking over the Loom project from &lt;a href="http://www.maximporges.com/"&gt;Maxim Porges&lt;/a&gt; (&lt;a class="externalLink" href="http://code.google.com/p/loom-as3/"&gt;http://code.google.com/p/loom-as3/&lt;/a&gt;). I had begun implementing an &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Aspect-oriented_programming"&gt;AOP&lt;/a&gt; solution for &lt;a href="http://www.springactionscript.org/"&gt;Spring Actionscript&lt;/a&gt;, first focusing on the pointcut scanning logic because I was following Maxim's progress with Loom and thought this would be an ideal library to use as its foundation.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Sadly, before the library was finished Maxim couldn't offer the personal resources anymore to continue the project. This certainly threw my schedule off :) At first I considered using the FLemit and FLoxy libraries but found that they were too specifically aimed at generating mocks. I need something more generic.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;So that's when I started spelunking through the Loom code and step-by-step I actually started to understand what was going on. Before, I was very reluctant since I considered this stuff way beyond my mortal understanding. But I managed to fix some bugs and that's when I contacted Maxim and asked him if it was alright for me take over the project and bring it into the &lt;a href="http://www.as3commons.org/"&gt;AS3Commons&lt;/a&gt; project.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Luckily Maxim was alright with this and so my nightmare begun haha :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;First thing I implemented was the bytecode based reflection. Since it appeared to be relatively simple and was a good way for me to get to know the code base a little. When this was done I started the task of finishing the parsing of all of the opcodes since this hadn't been completed yet. This was when the proverbial shit hit the fan because this is when I started to find out about subtle &lt;a href="http://www.adobe.com/content/dam/Adobe/en/devnet/actionscript/articles/avm2overview.pdf"&gt;AVM documentation&lt;/a&gt; errors. Or just plain non-existent documentation...Luckily, a trip through the Tamarin source code offered quite a lot of valuable insight as well.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Actually getting the opcode parsing completely to work only got finished a few weeks ago :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Next step was to generate classes at run-time. I was familiar enough with the ABC format by now to come up with an API to let a developer assemble an ABC file without needing to have any intimate knowledge of 'what lies beneath'. I actually used the &lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.emit.aspx"&gt;.NET System.emit namespace&lt;/a&gt; as an inspiration.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Around the time that class generation was implemented, James Ward contacted Maxim Porges to see if he could persuade him to continue his work on Loom since James and Michael Labriola had been hacking away on a mechanism that could intercept SWF loading by the Flash Player.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An ideal hook for AOP and other black magic.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Maxim then forwarded James to me and afterwards Michael and James offered some invaluable help and advice in further developing as3commons-bytecode. Eventually this culminated in their &lt;a href="https://github.com/MixingLoom"&gt;Mixing Loom&lt;/a&gt; project (&lt;a href="http://www.jamesward.com/2011/04/26/introducing-mixing-loom-runtime-actionscript-bytecode-modification/"&gt;James' blog introduction&lt;/a&gt;) and their fantastic session called '&lt;a href="http://zaa.tv/2011/06/360flex-denver-2011%E2%80%93planet-of-the-aops/"&gt;Planet of the AOPs&lt;/a&gt;' at the &lt;a href="http://www.360flex.com/"&gt;360|Flex conference&lt;/a&gt; in Denver. This was the first true introduction of AOP to the Flash community I guess you could say.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;After class generation was working the next step was to provide a generic API for generating dynamic run-time proxies. These are basically subclasses (generated at runtime) that incorporate an interception mechanism for methods and accessors (getters and setters). So when a method gets invoked on the dynamic subclass it will first invoke any registered interceptors, enabling these interceptor to perhaps change or replace the behavior of the underlying functionality. Most mocking libraries (like &lt;a href="http://asmock.sourceforge.net/"&gt;asmock&lt;/a&gt;, &lt;a href="http://mockolate.org/"&gt;mockolate&lt;/a&gt; or &lt;a href="https://bitbucket.org/loomis/mockito-flex/wiki/Home"&gt;mockito-flex&lt;/a&gt;) are based on this logic.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The API for this is explained in &lt;a href="http://www.as3commons.org/as3-commons-bytecode/proxy.html"&gt;this documentation section&lt;/a&gt; on the as3commons site.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Naturally, the most interesting solution that can be created using this proxy API are AOP mechanisms and quite soon after the proxy API became available &lt;a href="https://martypitt.wordpress.com/"&gt;Marty Pitt&lt;/a&gt; went ahead and created &lt;a href="https://code.google.com/p/flapper-as/"&gt;Flapper&lt;/a&gt;. An AOP extension for &lt;a href="http://www.spicefactory.org/parsley/"&gt;the Parsley framework&lt;/a&gt;. As if this wasn't enough, he then also created another library called &lt;a href="https://github.com/martypitt/ParsleyServices"&gt;Dynamic Services&lt;/a&gt;, also a Parsley extension. This library is able to take an interface that describes a service class and generate this service on-the-fly. This can save you a lot of typing :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="http://www.davidarno.org/"&gt;David Arno&lt;/a&gt; discovered the library as well and went out to create &lt;a href="https://github.com/DavidArno/AS3Introspection"&gt;AS3Introspection&lt;/a&gt;, a library that he himself dexcribes as "describeType on steroids". I think that pretty much covers it :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://twitter.com/#%21/jardilio"&gt;Jeff Ardillo&lt;/a&gt; then went ahead and showcased a technique to create proxies without having to depend on the ProxyFactory to create them in his excellent blog article '&lt;a href="http://blogs.cynergysystems.com/2011/08/15/aspect-oriented-programming-in-flex/"&gt;Aspect Oriented Programming in Flex&lt;/a&gt;'.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;I am very excited to see all of these initiatives take shape as this is exactly the reason why I started as3commons-bytecode. It was its specific aim to be a foundational library and facilitate a platform for other developers to base their own solutions on. Seeing this actually taking place is very satisfying indeed, so kudos to all of you who have taken the library to its next level!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Lately the Flash/Flex twitter- and blogosphere has been buzzing a lot with all sorts of AOP solutions. The &lt;a href="http://swizframework.org/"&gt;Swiz framework&lt;/a&gt; just announced their own AOP functionality in their upcoming version 2.0, for instance. This is all great news and opens up all sorts of new and exciting possibilities on the Flash platform.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;In that spirit, expect to see a new As3Commons project to be released in the near future as well. It'll be called as3commons-aop and will offer a bunch of standard interfaces and API's that deal with advices and pointcut scanning. Hopefully this will help developers to easily incorporate AOP functionality in other frameworks out there. As we are used to eating our own dogfood, Spring Actionscript will naturally use as3commons-aop as its AOP foundation :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Yet, I would like to stress, don't focus only on the AOP possibilities of as3commons-bytecode. I believe that projects like Marty Pitt's Dynamic Services show that much more can be achieved with the ability to generate classes at run-time. So be creative and try to come up with some more interesting solutions!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Thank you very much to everyone who has submitted bug reports, feature requests and developed solutions based as3commons-bytecode!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Happy coding!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;P.S. If you'd like to get involved with as3commons-bytecode's development or the as3commons project in general, please drop us a line! We always appreciate more help and contributions!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-5800612887935856911?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/5800612887935856911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/09/released-as3commons-bytecode-version-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5800612887935856911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5800612887935856911'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/09/released-as3commons-bytecode-version-10.html' title='Released: AS3Commons-Bytecode version 1.0!'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-4486368653490965299</id><published>2011-09-04T09:41:00.000-07:00</published><updated>2011-09-04T13:23:11.837-07:00</updated><title type='text'>Spring Actionscript v2.0 Progress Report - part III</title><content type='html'>We're gradually getting ready for a first beta release. Most of the foundational parts of the IoC container have now been refactored and unit tested. (Although the unit testing is still an ongoing process)&lt;br /&gt;Spring Actionscript 2.0 was put on the backburner just a little bit the past week since a bunch of debugging work for the &lt;a href="http://as3commons.org/as3-commons-bytecode/index.html" target="_blank"&gt;AS3Commons-Bytecode&lt;/a&gt; library took up just a little bit more time than was anticipated... Apologies for this. (But expect a new AS3Commons-Bytecode release as well in the coming days :))&lt;br /&gt;In the past few weeks the following has been added:&lt;br /&gt;&lt;h2&gt;IMetadataDestroyer interface&lt;/h2&gt;To be able to undo the processing of an &lt;i&gt;IMetadataprocessor&lt;/i&gt; a second interface has been added. Its much like the &lt;i&gt;IStageObjectProcessor&lt;/i&gt; and &lt;i&gt;IStageObjectDestroyer&lt;/i&gt; logic. One performs certain logic, the other is able to undo this logic in case this is necessary. The interface is quit simple:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;interface&lt;/span&gt; IMetadataDestroyer &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: green; font-weight: bold;"&gt;function&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;get&lt;/span&gt; metadataNames&lt;span style="color: #666666;"&gt;():&lt;/span&gt;Vector&lt;span style="color: #666666;"&gt;.&amp;lt;&lt;/span&gt;String&lt;span style="color: #666666;"&gt;&amp;gt;;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: green; font-weight: bold;"&gt;function &lt;/span&gt;&lt;span style="color: blue;"&gt;destroy&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;instance&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;Object&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; container&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;IMetadataContainer&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; metadataName&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;String&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; objectName&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;String&lt;/span&gt;&lt;span style="color: #666666;"&gt;):&lt;/span&gt;&lt;span style="color: #b00040;"&gt;void&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #666666;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;MXML Application context&lt;/h2&gt;Besides the XML based configuration, naturally, the MXML based configuration makes its comeback as well. It has changed slightly compared to the one in Spring Actionscript 1.x, but the changes aren't enormously disrupting.&lt;br /&gt;The MXMLApplicationContext itself is now also an MXML element, so here's how its declared in an application:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;s:Application&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;xmlns:fx=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"http://ns.adobe.com/mxml/2009"&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #7d9029;"&gt;xmlns:s=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"library://ns.adobe.com/flex/spark"&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #7d9029;"&gt;xmlns:mx=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"library://ns.adobe.com/flex/mx"&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #7d9029;"&gt;xmlns:sas=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"http://www.springactionscript.org/mxml/config"&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #7d9029;"&gt;creationComplete=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"application1_creationCompleteHandler(event)"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;fx:Declarations&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;sas:MXMLApplicationContext&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;configurations=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"{[TestObjects]}"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;configurationPackage=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"{new FullConfigurationPackage()}"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;id=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"MXMLContext"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;autoLoad=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"true"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;complete=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"{onComplete(event)}"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/fx:Declarations&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/s:Application&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;As you can see, the configuration is fed to this Application Context usingits 'configurations' property, which accepts an Array of Classes. In this casethe TestObjects class is also an MXML file and looks like this:&lt;br /&gt;&lt;divstyle="background: #f8f8f8;="" .1em="" .6em;"="" .8em;padding:.2em="" gray;border-width:.1em="" overflow:auto;width:auto;color:black;background:white;border:solid=""&gt;&lt;/divstyle="background:&gt;&lt;br /&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;sas:SASObjects&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;xmlns:fx=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"http://ns.adobe.com/mxml/2009"&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;xmlns:s=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"library://ns.adobe.com/flex/spark"&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;xmlns:mx=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"library://ns.adobe.com/flex/mx"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;xmlns:sas=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"http://www.springactionscript.org/mxml/config"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;fx:Script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #ba2121;"&gt;&amp;lt;![CDATA[&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: blue; font-weight: bold;"&gt;classes.MetadataHandler&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: blue; font-weight: bold;"&gt;mx.collections.ArrayCollection&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #666666;"&gt;[&lt;/span&gt;Bindable&lt;span style="color: #666666;"&gt;]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;var&lt;/span&gt; collection:&lt;span style="color: #b00040;"&gt;ArrayCollection&lt;/span&gt; &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;ArrayCollection&lt;/span&gt;&lt;span style="color: #666666;"&gt;([&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;'value1'&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; &lt;span style="color: #ba2121;"&gt;'value2'&lt;/span&gt;&lt;span style="color: #666666;"&gt;]);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #ba2121;"&gt;]]&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/fx:Script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;fx:Declarations&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;sas:Object&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;id=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"test"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;clazz=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"{Object}"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;sas:Property&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;name=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"list"&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #7d9029;"&gt;ref=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"collection"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/sas:Object&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;sas:Object&lt;/span&gt; &lt;span style="color: #7d9029;"&gt;clazz=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"{MetadataHandler}"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #7d9029;"&gt;id=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"metadataHandler"&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/fx:Declarations&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;&amp;lt;/sas:SASObjects&amp;gt;&lt;/span&gt;&lt;/pre&gt;The object definitions haven't changed at all from Spring Actionscript 1.x, apart from the extra properties that were described in part I of the progress report. As you can see, it's also possible to just declare regular object instantiatons in the configuration and have them being treated as singletons in the context. For instance the &lt;i&gt;ArrayCollection&lt;/i&gt; called &lt;b&gt;collection&lt;/b&gt; can be retrieved from the ApplicationContext simply by invoking &lt;i&gt;MXMLContext.getObject('collection');&lt;/i&gt;.&lt;br /&gt;As you can also see, the collection singleton is also being injected into the object called '&lt;b&gt;test&lt;/b&gt;' in its property called '&lt;b&gt;list&lt;/b&gt;'.&lt;br /&gt;Naturally, MXML object such as RemoteObject can also directly be declared inside the configuration, without having to resort to creating an &amp;lt;Object/&amp;gt; element for it. Direct declaration only works for singleton of course.&lt;br /&gt;The &lt;i&gt;MXMLApplicationContext&lt;/i&gt; is, like the &lt;i&gt;XMLApplicationContext&lt;/i&gt;, nothing but a convenience subclass. It also very much possible to construct one manually like this:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;var&lt;/span&gt; applicationContext:&lt;span style="color: #b00040;"&gt;DefaultApplicationContext&lt;/span&gt; &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;DefaultApplicationContext&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;null&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; rootView&lt;span style="color: #666666;"&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;var&lt;/span&gt; provider:&lt;span style="color: #b00040;"&gt;MXMLObjectDefinitionsProvider&lt;/span&gt; &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;MXMLObjectDefinitionsProvider&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;&lt;br /&gt;provider&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;addConfiguration&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;TestObjects&lt;span style="color: #666666;"&gt;);&lt;/span&gt;&lt;br /&gt;applicationContext&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;addDefinitionProvider&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;provider&lt;span style="color: #666666;"&gt;);&lt;/span&gt;&lt;br /&gt;applicationContext&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;addEventListener&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Event&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;COMPLETE&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; handleComplete&lt;span style="color: #666666;"&gt;);&lt;/span&gt;&lt;br /&gt;applicationContext&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;load&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;ICustomObjectDefinitionComponent interface&lt;/h2&gt;Similar to namespace handlers that make the XML configuration a little easier to read, the MXML configuration can contain &lt;i&gt;ICustomObjectDefinitionComponents&lt;/i&gt;. Implementations of this interface can define a custom configuration for a certain type of object and offer a few shortcuts for this configuration. The interface is quite easy again:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;interface&lt;/span&gt; ICustomObjectDefinitionComponent &lt;span style="color: green; font-weight: bold;"&gt;extends&lt;/span&gt; IMXMLObject &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: green; font-weight: bold;"&gt;function &lt;/span&gt;&lt;span style="color: blue;"&gt;execute&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;applicationContext&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;IApplicationContext&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt; objectDefinitions&lt;span style="color: #666666;"&gt;:&lt;/span&gt;&lt;span style="color: #b00040;"&gt;Object&lt;/span&gt;&lt;span style="color: #666666;"&gt;):&lt;/span&gt;&lt;span style="color: #b00040;"&gt;void&lt;/span&gt;&lt;span style="color: #666666;"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #666666;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;Once the &lt;i&gt;MXMLApplicationContext&lt;/i&gt; starts loading its &lt;i&gt;MXMLObjectDefinitionsProvider&lt;/i&gt; and encounters an &lt;i&gt;ICustomObjectDefinitionComponent&lt;/i&gt;, it will invoke its &lt;i&gt;execute()&lt;/i&gt; method and pass in a reference to the &lt;i&gt;MXMLApplicationContext&lt;/i&gt; and its &lt;i&gt;objectDefinitions&lt;/i&gt; instance.&lt;br /&gt;The objectDefinitions instance is an anonymous object that serves as a &lt;b&gt;Name&lt;/b&gt;-&amp;gt;&lt;i&gt;IObjectDefinition&lt;/i&gt; lookup for the definitions&lt;br /&gt;that are created by the &lt;i&gt;MXMLObjectDefinitionsProvider&lt;/i&gt;. So an &lt;i&gt;ICustomObjectDefinitionComponent&lt;/i&gt; implementation can just add its own&lt;br /&gt;definitions to this instance.&lt;br /&gt;No implementations are yet available in Spring Actionscript 2.0, but we're planning to create some shortcuts for the eventhandling and interception, similar to the XML shortcuts described in part II of this progress report.&lt;br /&gt;&lt;h2&gt;Metadata Application Context&lt;/h2&gt;Lastly, there is the &lt;i&gt;MetadataApplicationContext&lt;/i&gt;, which does exactly as its name suggests: It creates &lt;i&gt;ObjectDefinitions&lt;/i&gt; that are defined in metadata. This ApplicationContext needs to have its rootView set, this is because it uses this rootView to resolve the correct loaderInfo reference which is used to scan the SWF's bytecode for the necessary metadata annotations. So, if the MetadataApplicationContext is part of a regular application, this would suffice:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;var&lt;/span&gt; context:&lt;span style="color: #b00040;"&gt;MetadataApplicationContext&lt;/span&gt; &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;MetadataApplicationContext&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Application&lt;span style="color: #666666;"&gt;(&lt;/span&gt;FlexGlobals&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;topLevelApplication&lt;/span&gt;&lt;span style="color: #666666;"&gt;));&lt;/span&gt;&lt;br /&gt;context&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;addEventListener&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;Event&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;COMPLETE&lt;/span&gt;&lt;span style="color: #666666;"&gt;,&lt;/span&gt;onComplete&lt;span style="color: #666666;"&gt;);&lt;/span&gt;&lt;br /&gt;context&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;load&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;The metadata hasn't changed, you can check out the existing doc sections for&lt;br /&gt;it: &lt;a href="http://www.springactionscript.org/docs/reference/html/the_component_scanner.html"&gt;Spring Actionscript Component Scan&lt;/a&gt;.&lt;br /&gt;Only one addition has been made actually, it is now also possible to define an external properties file in metadata. To do so annotate any class in your project with the following metadata:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: #666666;"&gt;[&lt;/span&gt;ExternalProperties&lt;span style="color: #666666;"&gt;(&lt;/span&gt;location&lt;span style="color: #666666;"&gt;=&lt;/span&gt;&lt;span style="color: #ba2121;"&gt;"properties.txt"&lt;/span&gt;&lt;span style="color: #666666;"&gt;)]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;final&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;class&lt;/span&gt; ConfigurationClass &lt;span style="color: #666666;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #666666;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;Naturally, you can also add &lt;b&gt;required='true'&lt;/b&gt; or &lt;b&gt;preventCache='false'&lt;/b&gt; to the metadata arguments.&lt;br /&gt;&lt;h2&gt;spring-actionscript-flex.swc&lt;/h2&gt;As promised, all Flex specific functionality is now part of a separate .swc.&lt;br /&gt;So in order to use the &lt;i&gt;MXMLApplicationContext&lt;/i&gt; you will need to add the &lt;b&gt;spring-actionscript-flex.swc&lt;/b&gt; to your library path. The library also offers some extra namespace handlers that target flex specific classes. So in order to easily use those they have been packaged in an &lt;i&gt;IConfigurationPackage&lt;/i&gt; implementation called &lt;i&gt;FullFlexXMLConfigurationPackage&lt;/i&gt;.&lt;br /&gt;As described in part II of this progress report, you can add such a configuration package using the &lt;i&gt;configure()&lt;/i&gt; method on the application context:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;span style="color: green; font-weight: bold;"&gt;var&lt;/span&gt; context:&lt;span style="color: #b00040;"&gt;XMLApplicationContext&lt;/span&gt; &lt;span style="color: #666666;"&gt;=&lt;/span&gt; &lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;XMLApplicationContext&lt;/span&gt;&lt;span style="color: #666666;"&gt;();&lt;/span&gt;&lt;br /&gt;context&lt;span style="color: #666666;"&gt;.&lt;/span&gt;&lt;span style="color: #7d9029;"&gt;configure&lt;/span&gt;&lt;span style="color: #666666;"&gt;(&lt;/span&gt;&lt;span style="color: green; font-weight: bold;"&gt;new&lt;/span&gt; &lt;span style="color: #b00040;"&gt;FullFlexXMLConfigurationPackage&lt;/span&gt;&lt;span style="color: #666666;"&gt;());&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;Creating a build&lt;/h2&gt;The SVN repository has changed a little bit, so in order to create your own beta build things have changed slightly. First, check out this directory from the Spring SVN repository:&lt;br /&gt;&lt;div style="background: #f8f8f8; background: white; border-width: .1em .1em .1em .8em; border: solid gray; color: black; overflow: auto; padding: .2em .6em; width: auto;"&gt;&lt;pre style="line-height: 125%; margin: 0;"&gt;&lt;a href="http://www.blogger.com/%3C%21--%20HTML%20generated%20using%20hilite.me%20--%3E%3Cdiv%20style=%22background:%20#f8f8f8;%20overflow:auto;width:auto;color:black;background:white;border:solid%20gray;border-width:.1em%20.1em%20.1em%20.8em;padding:.2em%20.6em;%22%3E%3Cpr"&gt;https://src.springframework.org/svn/se-springactionscript-as/branches/2.0&lt;/a&gt;&lt;/pre&gt;&lt;/div&gt;In the checked out directory simple run this maven command: &lt;b&gt;mvn clean compile &lt;/b&gt;in order to create a build.&lt;br /&gt;Run &lt;b&gt;mvn clean test&lt;/b&gt; to run the unit tests.&lt;br /&gt;You will find the &lt;b&gt;spring-actionscript-core&lt;/b&gt; and &lt;b&gt;spring-actionscript-flex&lt;/b&gt; .swc's in their respective subdirectories. (spring-actionscript-core/target and spring-actionscript-flex/target)&lt;br /&gt;&lt;h2&gt;In the near future...&lt;/h2&gt;Next up there's still a number of unit tests to be ported from Spring Actionscript 1.x. After that the documentation site will be overhauled. The current site is very rich in information but we feel it needs to be organised better into smaller bite-sized chunks that might be easier to digest for developer's who are new to the framework.&lt;br /&gt;So we'll try and make a couple of 'Getting started' pages without immediately throwing every detail of the framework into the casual reader's face.&lt;br /&gt;We'll try and get http://beta.springactionscript.org up and running as soon as possible.&lt;br /&gt;&lt;h2&gt;In the further future...&lt;/h2&gt;We are in the planning stages of AOP support. In the past year we have been working hard on as3commons-bytecode which is the library that provides the most low-level support for AOP functionality, namely the creation of dynamic proxy classes and the dynamic manipulation of existing classes.&lt;br /&gt;Next we will release an as3commons project called as3commons-aop which will provide a foundational library offering advice and aspect interfaces, a pointcut scanning system combined with an expression dialect. The template for this will naturally be Spring AOP, but we will try to make the foundational library framework agnostic enough so that other frameworks might use it as well.&lt;br /&gt;This AOP library will then be used to implement the eventual Spring Actionscript AOP support.&lt;br /&gt;All of this is a huge task which is mostly done in our spare time, so naturally we can't give you any release schedule... :) &lt;br /&gt;Any help, however, is always welcome. So if you feel up for it, contact us either at as3commons.org or springactionscript.org (depending on what you'd like to do) and we'll see how we can help eachother out.&lt;br /&gt;And like previous posts, we'd love to hear feedback from you. So any criticisms, ideas, suggestions are more than welcome.&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-4486368653490965299?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/4486368653490965299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/09/spring-actionscript-v20-progress-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/4486368653490965299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/4486368653490965299'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/09/spring-actionscript-v20-progress-report.html' title='Spring Actionscript v2.0 Progress Report - part III'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-6242370434526552199</id><published>2011-08-22T12:45:00.000-07:00</published><updated>2011-08-22T13:02:03.636-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript'/><title type='text'>Spring Actionscript v2.0 Progress Report -  part II</title><content type='html'>&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;As promised, here's part II of the progress report on the ongoing development of Spring Actionscript v2.0.&lt;/div&gt;&lt;br /&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;Let's step through the new bits and pieces that were added, some were just literally ported from v1.0, other ones were ported and slightly tweaked while even others are completely new to the fold.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 align="left" style="font-family: Verdana,sans-serif;"&gt;Metadata processing&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;This has remained largely the same as in &lt;a href="http://www.springactionscript.org/docs/reference/html/annotations.html" target="_blank"&gt;Spring Actionscript v1.x&lt;/a&gt;, with the exception that most &lt;i&gt;Arrays&lt;/i&gt; have been converted into &lt;i&gt;Vector.&amp;lt;String&amp;gt;&lt;/i&gt;, so some small refactorings will be needed should you want to port any of your processors from&amp;nbsp;Spring &lt;br /&gt;Actionscript v1.x&amp;nbsp;projects.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;Usage hasn't changed at all, simply add an implementation of &lt;i&gt;IMetadataProcessor&lt;/i&gt; to the XML configuration and you're good to go.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 align="left" style="font-family: Verdana,sans-serif;"&gt;Eventbus namespace handler&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;New in Spring Actionscript v2.0 is the Eventbus namespace handler. This allows you to configure eventbus related tasks completely in XML. Spring Actionscript v1.x only offered a metadata solution, so to listen for events on the eventbus you'd need to annotate your class with the &lt;a href="http://www.springactionscript.org/docs/reference/html/the_eventbus.html#eventbus_event_handling_using_metadata_annotations" target="_blank"&gt;[EventHandler]&lt;/a&gt;&amp;nbsp; metadata. This puts a dependency on the framework, and therefore Spring Actionscript v2.0 allows the configuration to be completely external.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 align="left" style="font-family: Verdana,sans-serif;"&gt;Event handlers&lt;/h3&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;First add the eventbus namespace to the XML:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;objects xmlns="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp; xmlns:eventbus="&lt;a href="http://www.springactionscript.org/schema/eventbus"&gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp; xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp; xsi:schemaLocation="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/eventbus"&gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd&lt;/a&gt;"&amp;gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;To configure an object as an eventhandler, first add the object to the configuration as usual:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;objects xmlns="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;xmlns:eventbus="&lt;a &lt;br="" href="http://www.blogger.com/post-edit.g?blogID=8263529019533665919&amp;amp;postID=6242370434526552199"&gt;&amp;nbsp; href="http://www.springactionscript.org/schema/eventbus"&amp;gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;"&lt;br /&gt;&amp;nbsp;&amp;nbsp;xsi:schemaLocation="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/eventbus"&gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd&lt;/a&gt;"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;object id="eventHandler" class="com.myclasses.events.handlers.MyEventHandler"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left" style="font-family: Verdana,sans-serif;"&gt;Now, to configure this object as an eventhandler, add this eventbus specific configuration:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; &lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;objects xmlns="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;"&lt;br /&gt;xmlns:eventbus="&lt;a &lt;br="" href="http://www.blogger.com/post-edit.g?blogID=8263529019533665919&amp;amp;postID=6242370434526552199"&gt;&amp;nbsp; href="http://www.springactionscript.org/schema/eventbus"&amp;gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;"&lt;br /&gt;xmlns:xsi="&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;"&lt;br /&gt;xsi:schemaLocation="&lt;a href="http://www.springactionscript.org/schema/objects"&gt;http://www.springactionscript.org/schema/objects&lt;/a&gt;&lt;br /&gt;&lt;a&amp;nbsp; href="http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;a href="http://www.springactionscript.org/schema/eventbus"&gt;http://www.springactionscript.org/schema/eventbus&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd"&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-eventbus-2.0.xsd&lt;/a&gt;"&amp;gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;lt;object id="eventHandler" class="com.myclasses.events.handlers.MyEventHandler"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;lt;eventbus:event-handler instance="eventHandler"&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;eventbus:event-handler-method method-name="handler" event-name="testEvent"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-handler&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;/a&amp;nbsp;&gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; This basically says: Use the method &lt;i&gt;handler&lt;/i&gt; on the instance &lt;i&gt;eventHandler&lt;/i&gt; to handle events of type &lt;i&gt;testEvent&lt;/i&gt; coming through the eventbus.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; If you need to listen to events of type testEvent that have been associated with a certain topic, configure the topic like this:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; &lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-handler-method method-name="handler" event-name="testEvent" topics="topicName"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; Its also possible that the topic is defined by one of the properties on the eventHandler instance, let's say the eventHandler instance has a property called securityToken which is also used a topic filter. You can &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;define this like so:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; &lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-handler-method method-name="handler" event-name="testEvent" topic-properties="securityToken "/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; Both attributes (topics, and topic-properties) can contain multiple entries, just as long as they're entered as comma delimited strings:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp; &lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-handler-method method-name="handler" event-name="testEvent" topics="topicName1,topicName2"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;To listen for a specific event class, add the fully qualified class name like this:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-handler-method method-name="handler" event-class="com.classes.events.MyCustomEvent"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Verdana,sans-serif;"&gt;Routing events&lt;/h3&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Spring Actionscript 1.x offers the &lt;a &lt;br="" href="http://www.springactionscript.org/docs/reference/html/the_eventbus.html#routing_other_events_through_the_eventbus" target="_blank"&gt;[RouteEvents]&lt;/a&gt; metadata to automatically send certain events dispatched by ordinary IEventDispatchers through the eventbus, Spring Actionscript 2.0 now also offers XML configuration for this:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-router instance="myEventDispatcher"&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;eventbus:routing-configuration event-names="testEvent"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-router&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;This sends each event of type &lt;i&gt;testEvent&lt;/i&gt; dispatched by the instance with the object name &lt;i&gt;myEventDispatcher&lt;/i&gt; through the eventbus.Same as the event-handler, its possible to define topics &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;directly or topic defined by properties on the IEventDispatcher instance:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:routing-configuration event-names="testEvent" topics="myTopic1,myTopic2"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;To send multiple types entered the event types comma delimited:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:routing-configuration event-names="testEvent, testEvent2" topics="myTopic1"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Or if different events need to be dispatched using different topics:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-router instance="myEventDispatcher"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;eventbus:routing-configuration event-names="testEvent" topics="myTopic1"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;eventbus:routing-configuration event-names="testEvent2" topics="myTopic2"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-router&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Verdana,sans-serif;"&gt;Event interceptors&lt;/h3&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The as3commons eventbus offers ways to intercept, block or manipulate events coming through the eventbus. For more information, check out the &lt;a href="http://http//www.as3commons.org/as3-commons-eventbus/introduction.html" target="_blank"&gt;as3commons-eventbus documentation&lt;/a&gt; .&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;To define them using XML configuration, first define an object that implements the &lt;i&gt;IEventInterceptor&lt;/i&gt;&amp;nbsp; instance and then use&amp;nbsp;mark-up like this to configure it:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-interceptor instance="myEventInterceptor"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;eventbus:interception-configuration event-name="testEvent"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-interceptor&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Of course, this can be configured for an event class as well, with optionally topics or topic-properties attributes:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:interception-configuration event-class="testEvent" topics="myTopic"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An interceptor can have multiple interception configurations:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-interceptor instance="myEventInterceptor"&amp;gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;lt;eventbus:interception-configuration event-name="testEvent"/&amp;gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;lt;eventbus:interception-configuration event-class="com.classes.events.MyCustomEvent"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-interceptor&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style="font-family: Verdana,sans-serif;"&gt;Event listener interceptors&lt;/h3&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;There is also such a thing as event listener interceptors, they can be used, for instance, to control the number of event listeners for a specific event or event class. The configuration for this is almost the same a event interceptors, only make sure to first define an object that implements the &lt;i&gt;IEventListenerInterceptor&lt;/i&gt; interface. Then configure it like this:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;eventbus:event-listener-interceptor instance="myEventListenerInterceptor"&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;eventbus:interception-configuration event-name="testEvent"/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;eventbus:interception-configuration event-class="com.classes.events.MyCustomEvent"/&amp;gt;&lt;br /&gt;&amp;lt;/eventbus:event-listener-interceptor&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Configuration packs&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An application context on its own contains as little custom functioanlity as possible. The only things that are automatically part of the &lt;i&gt;ApplicationContext&lt;/i&gt; are dependency injection, autowiring, stage interception and the metada processor registration. To prevent having to type lengthy bootstrap code, Spring Actionscript v2.0 contains configuration packs.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;These packs are defined by &lt;i&gt;IConfigurationPackage&lt;/i&gt; implementations. For instance, to add the stageprocessing, eventbus, task and util namespace handlers to the &lt;i&gt;XMLApplicationContext&lt;/i&gt;, simply invoke the &lt;i&gt;XMLApplicationContext.configure()&lt;/i&gt; method and pass in an instance of &lt;i&gt;FullXMLConfigurationPack&lt;/i&gt; .&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;var applicationContext:XMLApplicationContext = new XMLApplicationContext("application-context.xml");&lt;br /&gt;applicationContext.configure(new FullXMLConfigurationPack());&lt;br /&gt;applicationContext.addEventListener(Event.COMPLETE, onComplete);&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;That way normal users can just add the whole she-bang in one go, while the power users can pick and choose and add the specific functionality they need.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Child application contexts&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Spring Actionscript v1.x enables you to add a parent context to an ApplicationContext, this functionality remains in version 2.0. &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;However, the idea of a context having a direct reference to its parent also goes against &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt; principles, where an instance shouldn't know where to &lt;i&gt;get&lt;/i&gt; its dependencies, it should instead just &lt;i&gt;receive&lt;/i&gt; them. (Thanks Martin! :))&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Spring Actionscript v2.0 now enables an &lt;i&gt;ApplicationContext&lt;/i&gt; to receive one or more &lt;i&gt;child&lt;/i&gt; contexts. They can be added using the &lt;i&gt;ApplicationContext.addChildContext()&lt;/i&gt; method.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The advantage of&amp;nbsp;having a&amp;nbsp;parent-&amp;gt;child relationship, instead of a child-&amp;gt;parent is that the parent can decide what it will share with its child contexts. Let's first take a look at the signature &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;of the &lt;i&gt;addChildContext&lt;/i&gt; method:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;function addChildContext(childContext:IApplicationContext, shareDefinitions:Boolean=true, shareSingletons:Boolean=true, shareEventBus:Boolean=true):void;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;So, by default the parent context will share everything with its children. It will register clones of all of its object definitions, it will register all of its singletons in the child's cache and will make sure that all of its eventbus events will be routed through its child eventbus as well. &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Obviously, by setting one of these parameters to &lt;i&gt;false&lt;/i&gt; will prevent&amp;nbsp;a specific action&amp;nbsp;from happening.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Its also possible to define &lt;i&gt;which&lt;/i&gt; object definitions and/or singletons will be shared. The &lt;i&gt;ObjectDefinition&lt;/i&gt; class has a property called &lt;i&gt;childContextAccess&lt;/i&gt; which is of type &lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;i&gt;ChildContextObjectDefinitionAccess&lt;/i&gt;. This is an enumration which has the following values and related meaning:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;NONE - No access, do not share with child contexts&lt;/li&gt;&lt;li&gt;DEFINITION - Only share the object definition&lt;/li&gt;&lt;li&gt;SINGLETON - Only share the singleton&lt;/li&gt;&lt;li&gt;FULL - Share both the definition and the singleton&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;This will hopefully give enough control to a developer to decide what to share and what not. If somebody has ideas on how to improve this, we'd love to hear about :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;In conclusion&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Right, that's about it for part II of the Spring Actionscript v2.0 Progress Report. Like stated in the previous post, if you feel up for it, checkout the sources from SVN, use the provided maven script to create a build and start testing around a bit.&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Here's all the information again:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://src.springframework.org/svn/se-springactionscript-as/branches/2.0/spring-actionscript-core" target="_blank"&gt;https://src.springframework.org/svn/se-springactionscript-as/branches/2.0/spring-actionscript-core&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;You can use the maven pom in the root directory to create a working build of the Spring Actionscript core. It assumed you have Maven version 3.0.3 installed. All of the dependencies will copied to the target/dependencies directory.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Use &lt;b&gt;mvn clean compile&lt;/b&gt; to create a build and &lt;b&gt;mvn clean test&lt;/b&gt; to run the unit tests.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Either leave a comment on this blog or visit our JIRA system for any criticism, ideas or suggestions:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://jira.springsource.org/browse/SESPRINGACTIONSCRIPTAS" target="_blank"&gt;Spring Source JIRA&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Thanks a lot for again for listening to me ramble, it is greatly appreciated :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Happy coding!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-6242370434526552199?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/6242370434526552199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/08/spring-actionscript-v20-progress-report_22.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/6242370434526552199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/6242370434526552199'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/08/spring-actionscript-v20-progress-report_22.html' title='Spring Actionscript v2.0 Progress Report -  part II'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-4102517481341047355</id><published>2011-08-18T12:12:00.000-07:00</published><updated>2011-08-22T01:26:56.752-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript'/><title type='text'>Spring Actionscript v2.0 Progress Report</title><content type='html'>&lt;div style="font-family: Verdana,sans-serif;"&gt;For the past several weeks we have been busy working on what will become Spring Actionscript version 2.0. The work is still in the alpha stages, but we thought it might be interesting for people to read about our progress and perhaps give us some criticism or ideas in the process.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The reasons for a complete overhaul were the following:&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;More reliance on composition rather than inheritance internally &lt;/li&gt;&lt;li&gt;Less memory consumption&lt;/li&gt;&lt;li&gt; Asynchronous ObjectFactoryPostProcessors&lt;/li&gt;&lt;li&gt;Complete separation of Actionscript and Flex dependent parts &lt;/li&gt;&lt;li&gt;Refocus back to being an &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt; container&lt;/li&gt;&lt;li&gt;Make sure *everything* lives behind an interface&lt;/li&gt;&lt;li&gt;Upgrade of the testing project to Flexunit 4 and the use of a mocking library&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Making things smaller.&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;First of all, the Spring Actionscript core was starting to get bloated. There was the eventbus that got added, the operation API, a micro &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Model%E2%80%93view%E2%80%93controller" target="_blank"&gt;MVC&lt;/a&gt; architecture, etc.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;We felt it was needed that the core library should be an &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt; container, and nothing else. So in the last few months you may have seen quite few new &lt;a href="http://www.as3commons.org/" target="_blank"&gt;as3commons&lt;/a&gt; projects pop up that seemed familiar. (If you're a Spring Actionscript user of course.)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Well, that's because we have been busy cutting out the bloat :) The following &lt;a href="http://www.as3commons.org/" target="_blank"&gt;as3commons&lt;/a&gt; project have so far been created out of the refactorings in Spring Actionscript:&lt;/div&gt;&lt;ul style="font-family: Verdana,sans-serif;"&gt;&lt;li&gt;&lt;a href="http://www.as3commons.org/as3-commons-async/index.html"&gt;as3commons-async&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.as3commons.org/as3-commons-eventbus/index.html"&gt;as3commons-eventbus&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.as3commons.org/as3-commons-stageprocessing/index.html"&gt;as3commons-stageprocessing&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Of course the &lt;a href="http://www.as3commons.org/as3-commons-reflect/index.html"&gt;as3commons-reflect&lt;/a&gt; and &lt;a href="http://www.as3commons.org/as3-commons-lang/index.html"&gt;-lang&lt;/a&gt; projects already originated from the Spring Actionscript v1.x code base.&lt;br /&gt;This comes much closer to the original philosophy of Spring Actionscript which is focused on re-use. All these libraries are autonomous API's that can be used perfectly well on their own, but bundled together with the Spring Actionscript &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt; container may be turned into a powerhouse. :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Breaking things up further.&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The new Spring Actionscript core itself is a pure actionscript library that can be used in non-Flex projects. i.e. &lt;i&gt;springactionscript-core.swc&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Any Flex specific functionality will be released as a separate .swc. i.e. &lt;i&gt;springactionscript-flex.swc&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Any other functionality will be released also as separate projects, that way you can pick and choose what you need for a particular project. i.e. &lt;i&gt;springactionscript-mvc.swc&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;We will do our best to offer different kinds of packages for different needs. For instance we will release one huge master swc that contains all of the libraries, extensions and dependencies. But there will also be releases in the form of an archive filled with all the necessary .swc files.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Separating concerns in the object factory.&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Spring Actionscript 1.x started out only supporting XML configurations, so all of the loading and parsing logic was in the base class of the object factory. When afterwards MXML and annotation based configuration was implemented this lead to an incredibly 'heavy' base class with quite a bit of logic that wasn't always needed in all usage scenario's.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The first thing that had to be done was to split up the object factory in functionally separate classes. The &lt;i&gt;IObjectFactory &lt;/i&gt;now is only responsible for what its name indicates: Creating objects. It is composed however of an &lt;i&gt;IInstanceCache&lt;/i&gt;, an &lt;i&gt;IObjectDefinitionRegistry&lt;/i&gt;, an &lt;i&gt;IDependencyInjector &lt;/i&gt;and an &lt;i&gt;IAutowireProcessor&lt;/i&gt;. This immediately made unit testing a lot easier since the separation of concerns was a lot clearer by then.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The main entry point for most developers, the &lt;i&gt;IApplicationContext&lt;/i&gt;, is now responsible for configuring the &lt;i&gt;IObjectFactory&lt;/i&gt;. It serves as a registry for one or more &lt;i&gt;IObjectDefinitionProvider &lt;/i&gt;implementations.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An IObjectDefinitionProvider is responsible for creating the &lt;i&gt;IObjectDefinitions &lt;/i&gt;(the separate configuration recipes for objects created by the &lt;i&gt;IObjectFactory&lt;/i&gt;), in the case of XML this means the loading of XML file(s) (be it external, embedded or explicit), parsing this XML and creating &lt;i&gt;IObjectDefinitions &lt;/i&gt;from it. Each &lt;i&gt;IObjectDefinitionProvider &lt;/i&gt;is also responsible for reporting any property URI's encountered in the configuration. These property files will afterwards be loaded by an &lt;i&gt;ITextFilesLoader &lt;/i&gt;and parsed by an &lt;i&gt;IPropertiesParser &lt;/i&gt;which eventually will populate an &lt;i&gt;IPropertiesProvider&lt;/i&gt;.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The direct advantage of moving all of this logic into separate object instances is that after the configurations have been processed by their responsible &lt;i&gt;IObjectDefinitionsProviders&lt;/i&gt;, these providers can be discarded, freeing up memory.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;After the object definitions have been created each &lt;i&gt;IObjectFactoryPostProcessor &lt;/i&gt;will be executed. These postprocessors can be used to analyze the registered object definitions and provide some extra configuration.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;For instance the &lt;i&gt;StageProcessorFactoryPostprocessor &lt;/i&gt;will search the &lt;i&gt;IObjectDefinitionRegistry &lt;/i&gt;for implementations of &lt;i&gt;IStageObjectProcessor &lt;/i&gt;and registers them with the &lt;i&gt;IStageObjectProcessorRegistry &lt;/i&gt;instance that has been assigned to the &lt;i&gt;IApplicationContext&lt;/i&gt;.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;One of these &lt;i&gt;IStageObjectProcessors &lt;/i&gt;is the &lt;i&gt;DefaultAutowiringStageProcessor&lt;/i&gt;, which takes care of the autowiring of stage components in Spring Actionscript.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An &lt;i&gt;IObjectFactoryPostProcessor &lt;/i&gt;can now also perform its logic asynchronously (this isn't the case in version 1.x), so a server call can be made for instance. Or, in the future, we will probably support some type of &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Aspect-oriented_programming"&gt;AOP&lt;/a&gt; system that will generate classes at runtime. These are also asynchronous processes, so the &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Inversion_of_Control"&gt;IoC&lt;/a&gt; container will be ready for those.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Creating the new contexts.&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Now, to make use of an XML configuration the following code would be needed to get the &lt;i&gt;ApplicationContext &lt;/i&gt;ready for use:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;var applicationContext:IApplicationContext = new ApplicationContext();&lt;br /&gt;var provider:XMLObjectDefinitionsProvider = new XMLObjectDefinitionsProvider();&lt;br /&gt;provider.addLocation("application-context.xml");&lt;br /&gt;applicationContext.addDefinitionProvider(provider);&lt;br /&gt;applicationContext.addEventListener(Event.COMPLETE, onComplete);&lt;br /&gt;applicationContext.load();&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;To make life a little easier we will be providing the necessary subclasses of the ApplicationContext for the various types of configuration. For an application context that uses an XML configuration we offer the XMLApplicationContext. This subclass will automatically create the &lt;i&gt;XMLObjectDefinitionsProvider&lt;/i&gt; and register it. Creating and loading would only need this bit of code in that case:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;var applicationContext:XMLApplicationContext = new XMLApplicationContext("application-context.xml");&lt;br /&gt;applicationContext.addEventListener(Event.COMPLETE, onComplete);&lt;br /&gt;applicationContext.load();&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Note: The location for an XML configuration can be of type &lt;i&gt;String&lt;/i&gt;, &lt;i&gt;Class&lt;/i&gt; or &lt;i&gt;XML&lt;/i&gt;. When the loader encounters a &lt;i&gt;String&lt;/i&gt; it will assume it is a URL, in the case of a &lt;i&gt;Class&lt;/i&gt; it will assume it is an embedded XML file, and in the case of XML it will directly parse the provided XML object.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Subclasses for MXML, annotation and Actionscript based configuration will each have their own subclass for convenience. Mixing different types of configuration will still be possible, one needs only to add an appropriate &lt;i&gt;IObjectDefinitionsProvider&lt;/i&gt; to the context manually. These subclasses are really meant for common usage scenarios.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Tweaking the XML dialect.&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The XML configuration dialect has remained largely the same, with some additional new possibilities though.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Properties and method invocations can now be configured for members that live in a custom namespace. The &lt;property&gt; and &lt;method-invocation&gt; elements both have a namespace attribute now:&lt;/method-invocation&gt;&lt;/property&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;property name="myProperty" namespace="http://www.mydomain.org/custom" value="myValue"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;method-invocation name="myMethod" namespace="http://www.mydomain.org/custom"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Static properties may be injected as well: &lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&amp;lt;property name="myStaticProperty" value="myValue" static="true"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;For explicit null values the &lt;i&gt;&amp;lt;null/&amp;gt;&lt;/i&gt; element already existed, we now also support &lt;i&gt;&amp;lt;undefined/&amp;gt;&lt;/i&gt; and &lt;i&gt;&amp;lt;not-a-number/&amp;gt;.&lt;/i&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Any suggestions for more additions are welcome of course :)&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Taking advantage of your parents.&lt;/h2&gt;&lt;br /&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;An &lt;i&gt;ApplicationContext&lt;/i&gt; can have another context as its parent. The nice thing about this is that a child context can inject an object that it created with an instance that is managed by its parent context. It is also possible for a child context to override certain objects by registering an object definition with the same name.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;This functionality was already in place in Spring Actionscript v1.x, but Spring Actionscript v2.0 now offers a subtle bit of extra flexibility. Should a context have overridden an object, but in a certain case &lt;i&gt;still&lt;/i&gt; need to inject the original instance present in the parent factory, the configuration can be set like this:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&amp;lt;property name="myComplexProperty" ref="parent.myValue"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;In the case where there is a chain of parent/child contexts, this can even be brought higher up the chain like this:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&amp;lt;property name="myComplexProperty" ref="parent.parent.myValue"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Wiring stage components.&lt;/h2&gt;&lt;br /&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;The way the stage autowiring processor is being added to the XML configuration has changed slightly as well. In version v1.0 you just needed to add a regular object definition like this:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&amp;lt;object class="org.springextensions.actionscript.stage.DefaultAutowiringStageProcessor" id="autowiringStageProcessor"/&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;In version 2.0 we have added a separate XML namespace for autowiring, which makes things slightly easier to read. (Hopefully...):&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&amp;lt;objects xmlns="http://www.springactionscript.org/schema/objects"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;b&gt;xmlns:stage="http://www.springactionscript.org/schema/stageprocessing"&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;xsi:schemaLocation="http://www.springactionscript.org/schema/objects http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stage:autowiringstageprocessor/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;A custom &lt;i&gt;IStageObjectProcessor &lt;/i&gt;can be configured like this with a custom &lt;i&gt;IObjectSelector&lt;/i&gt;:&lt;/div&gt;&lt;blockquote style="font-family: Verdana,sans-serif;"&gt;&amp;lt;objects xmlns="http://www.springactionscript.org/schema/objects"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;b&gt;xmlns:stage="http://www.springactionscript.org/schema/stageprocessing"&lt;/b&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;xsi:schemaLocation="http://www.springactionscript.org/schema/objects http://www.springactionscript.org/schema/objects/spring-actionscript-objects-2.0.xsd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;object id="customSelector" class="com.classes.MyCustumSelector"/&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;stage:stageprocessor class="com.classes.MyProcessor" object-selector="custumSelector"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;/blockquote&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style="font-family: Verdana,sans-serif;"&gt;Where do we go from here?&lt;/h2&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;If you're interested in playing around with the new library, you can. Of course we can't stress enough the fact that this is alpha code and should *definitely* not be used in a production environment. But if you're feeling adventurous and want to try things out, go ahead and check out the 2.0 branch in our SVN repository:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://src.springframework.org/svn/se-springactionscript-as/branches/2.0/spring-actionscript-core" target="_blank"&gt;https://src.springframework.org/svn/se-springactionscript-as/branches/2.0/spring-actionscript-core&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;You can use the maven pom in the root directory to create a working build of the Spring Actionscript core. It assumed you have Maven version 3.0.3 installed. All of the dependencies will copied to the target/dependencies directory.&lt;br /&gt;Use &lt;b&gt;mvn clean compile&lt;/b&gt; to create a build and &lt;b&gt;mvn clean test&lt;/b&gt; to run the unit tests.&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;So far XML configuration and stage wiring ought to be working. If you encounter any bugs or have any ideas for new functionality, please let us know!&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Either leave a comment on this blog or visit our JIRA system:&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://jira.springsource.org/browse/SESPRINGACTIONSCRIPTAS"&gt;Spring Source JIRA&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: Verdana,sans-serif;"&gt;Thanks a lot for taking the time to read all of this, we will let you know how we progress further!&lt;br /&gt;&lt;br /&gt;Happy coding!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-4102517481341047355?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/4102517481341047355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2011/08/spring-actionscript-v20-progress-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/4102517481341047355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/4102517481341047355'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2011/08/spring-actionscript-v20-progress-report.html' title='Spring Actionscript v2.0 Progress Report'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-3909942420635160792</id><published>2010-12-29T09:41:00.000-08:00</published><updated>2010-12-29T09:44:06.460-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='actionscript as3commons bytecode AOP proxy'/><title type='text'>AS3Commons-Bytecode v0.9.2 released</title><content type='html'>The last two days two updates to AS3Commons-Bytecode were released, v0.9.1 and today v0.9.2 to be precise.&lt;br /&gt;&lt;br /&gt;The most important additions in these two releases have been the support for proxying protected and custom namespace members. I ran into a bunch of issues during development but wanted to get the API out so that people could play around with it and perhaps come up with some constructive criticism. Therefore the first v0.9 release only supported public members, enough for some basic testing and trying out.&lt;br /&gt;Luckily in the past few evenings I've been able to track down the issues I had surrounding generation of protected and custom namespace scoped members.&lt;br /&gt;&lt;br /&gt;It came down to a few bugs in the Bytecode reflection and emit.* API, that'll teach me to unit test better I suppose. :)&lt;br /&gt;&lt;br /&gt;Another handy addition are a bunch of build cycle events that allow a developer to customize the generation of the method bodies. All of them are explained in this doc section:&lt;br /&gt;&lt;a href="http://www.as3commons.org/as3-commons-bytecode/proxy.html#Generating_the_proxy_classes"&gt;Generating the proxy classes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Furthermore, the library now offers an entry point for using an IFactory implementation to take care off the creation of IMethodInvocationInterceptors. How this is hooked up is described in this section:&lt;br /&gt;&lt;a href="http://www.as3commons.org/as3-commons-bytecode/proxy.html#Instantiating_a_proxy_class"&gt;Instantiating a proxy class&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For the next release I'll be focusing on what they call in AOP terms 'introductions', which means that the library will enable you to let proxy classes implement new interfaces at runtime. Handy for when an object needs an 'isDirty' property, for instance.&lt;br /&gt;&lt;br /&gt;When that's finished I suppose a version 1.0 should be ready.&lt;br /&gt;Beyond v1.0 will be bytecode weaving based AOP, this is going to introduce its own set of difficulties to overcome which is why I've decided to push it back after the v1.0 release.&lt;br /&gt;&lt;br /&gt;Cheers and a happy new year!&lt;br /&gt;&lt;br /&gt;Roland&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-3909942420635160792?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/3909942420635160792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2010/12/as3commons-bytecode-v092-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3909942420635160792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3909942420635160792'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2010/12/as3commons-bytecode-v092-released.html' title='AS3Commons-Bytecode v0.9.2 released'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-3100374628345899921</id><published>2010-12-26T14:19:00.000-08:00</published><updated>2010-12-29T09:44:28.864-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='actionscript as3commons bytecode AOP proxy'/><title type='text'>AS3Commons-Bytecode v0.9 released</title><content type='html'>Today saw the release of v0.9 of AS3Commons-Bytecode, an ABC bytecode parsing/publishing and bytecode based reflection API for ActionScript 3.0, formerly known as Loom. (http://code.google.com/p/loom-as3/).&lt;br /&gt;&lt;br /&gt;It offers bytecode based reflection, giving a developer access to a much richer set of reflection information than that retrieved from the native describeType() method.&lt;br /&gt;Check this link for more information about this feature: &lt;a href="http://www.as3commons.org/as3-commons-bytecode/introduction.html"&gt;Bytecode reflection&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Secondly it offers the emit API, enabling a developer to define, generate and load Actionscript classes at runtime.&lt;br /&gt;Check this link for more information about this feature: &lt;a href="http://www.as3commons.org/as3-commons-bytecode/emit.html"&gt;Runtime class generation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And lastly, the library has just added support for runtime dynamic proxy generation in this v0.9 release. Dynamic proxies will bring the first, albeit limited, AOP possibilities to Actionscript.&lt;br /&gt;Check this link for more information about this feature: &lt;a href="http://www.as3commons.org/as3-commons-bytecode/proxy.html"&gt;Dynamic proxy generation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For the upcoming release support for proxying protected and custom namespace scoped members for dynamic proxies is planned. Along with bytecode weaving AOP support.&lt;br /&gt;&lt;br /&gt;Until then, try out the library and report any bugs or ideas here: &lt;a href="https://code.google.com/p/as3-commons/issues/list"&gt;Issues&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;Roland&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-3100374628345899921?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/3100374628345899921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2010/12/as3commons-bytecode-v09-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3100374628345899921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3100374628345899921'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2010/12/as3commons-bytecode-v09-released.html' title='AS3Commons-Bytecode v0.9 released'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-913939497048018274</id><published>2010-09-13T04:54:00.000-07:00</published><updated>2010-12-29T09:46:20.831-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='actionscript IoC Spring release library'/><title type='text'>Spring Actionscript 1.0 released!</title><content type='html'>As usual Herrodius.com has the complete lowdown:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.herrodius.com/blog/350"&gt;http://www.herrodius.com/blog/350&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or you can head over to the changelog immediately:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/changes-report.html#a1.0"&gt;http://www.springactionscript.org/changes-report.html#a1.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if you have any questions or criticism, please visit the forums:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forum.springsource.org/forumdisplay.php?f=60"&gt;http://forum.springsource.org/forumdisplay.php?f=60&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-913939497048018274?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/913939497048018274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2010/09/spring-actionscript-10-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/913939497048018274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/913939497048018274'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2010/09/spring-actionscript-10-released.html' title='Spring Actionscript 1.0 released!'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-5744922679303757297</id><published>2010-03-01T12:01:00.000-08:00</published><updated>2010-03-01T12:01:50.651-08:00</updated><title type='text'>Released: Spring Actionscript version 1.0 Release Candidate 1 now available!</title><content type='html'>Finally, Spring Actionscript 1.0 RC1 sees the light of day!&lt;br /&gt;&lt;br /&gt;Get all the juicy details over at Herrodius' blog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.herrodius.com/blog/273"&gt;http://www.herrodius.com/blog/273&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;or just read the changelog here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/changes-report.html#a1.0RC1"&gt;http://www.springactionscript.org/changes-report.html#a1.0RC1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;if you have any questions or criticism, please visit the forums:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forum.springsource.org/forumdisplay.php?f=60"&gt;http://forum.springsource.org/forumdisplay.php?f=60&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-5744922679303757297?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/5744922679303757297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2010/03/released-spring-actionscript-version-10.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5744922679303757297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5744922679303757297'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2010/03/released-spring-actionscript-version-10.html' title='Released: Spring Actionscript version 1.0 Release Candidate 1 now available!'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-2336969316386339282</id><published>2009-09-15T13:59:00.000-07:00</published><updated>2009-09-15T14:03:50.010-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript release'/><title type='text'>Spring Actionscript version 0.8.1 released!</title><content type='html'>Its mainly a maintenance release with a slew of bugfixes, but there's some new functionality in there as well.&lt;br /&gt;Read the full story at Herrodius' blog as per usual:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.herrodius.com/blog/208"&gt;http://www.herrodius.com/blog/208&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download away:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/"&gt;http://www.springactionscript.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's the changelog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/changes-report.html#a0.8.1"&gt;http://www.springactionscript.org/changes-report.html#a0.8.1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And should you find any bugs or have some feature request, please head on over to JIRA:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jira.springframework.org/browse/SESPRINGACTIONSCRIPTAS"&gt;http://jira.springframework.org/browse/SESPRINGACTIONSCRIPTAS&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;cheers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-2336969316386339282?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/2336969316386339282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/09/spring-actionscript-v081-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2336969316386339282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2336969316386339282'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/09/spring-actionscript-v081-released.html' title='Spring Actionscript version 0.8.1 released!'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-3089851387320438112</id><published>2009-07-17T09:40:00.000-07:00</published><updated>2009-07-22T06:38:03.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript release'/><title type='text'>Spring Actionscript version 0.8 released!</title><content type='html'>Get the full story at herrodius blog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.herrodius.com/blog/176"&gt;herrodius.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;read the new documentation site front to back:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.springactionscript.org/"&gt;springactionscript.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For all people upgrading from an older version and haven't done so, make sure you change the namespace declarations in your configuration files! Failing to do so will prevent springactionscript from working properly. (well, it won't work at all actually :))&lt;br /&gt;This is what your XML should look like:&lt;br /&gt;&lt;br /&gt;&lt;pre class="programlisting"&gt;&amp;lt;objects xmlns="http://www.springactionscript.org/schema/objects"&lt;br /&gt;xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;schemalocation="http://www.springactionscript.org/schema/objects                  &lt;br /&gt;http://www.springactionscript.org/schema/objects/spring-actionscript-objects-1.0.xsd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;/pre&gt;&lt;br /&gt;That's the most important part to check.&lt;br /&gt;&lt;br /&gt;Here's a quick glance at the changelog:&lt;br /&gt;&lt;br /&gt;Changes in version 0.8 (16.07.2009)&lt;br /&gt;-----------------------------------&lt;br /&gt;&lt;br /&gt;General&lt;br /&gt;* new website at www.springactionscript.org&lt;br /&gt;* factored out common functionality into the AS3Commons projects (http://www.as3commons.org)&lt;br /&gt;* major update to the documentation&lt;br /&gt;* added autowire support&lt;br /&gt;* added custom namespace handler support&lt;br /&gt;* restructured subversion repository&lt;br /&gt;* updated samples&lt;br /&gt;* various performance improvements&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.cairngorm&lt;br /&gt;* added IDataTranslator and IDataTranslatorAware interfaces&lt;br /&gt;* added AbstractDataTranslatorAwareBusinessDelegate base class&lt;br /&gt;* added 'batch command' support to CairngormFrontController&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.context.support.mxml&lt;br /&gt;* added entire package for MXML support for application contexts&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.domain&lt;br /&gt;* moved Enum to AS3Commons-Lang&lt;br /&gt;* moved ICloneable to AS3Commons-Lang&lt;br /&gt;* moved IEquals to AS3Commons-Lang&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.errors&lt;br /&gt;* moved IllegalArgumentError to AS3Commons-Lang&lt;br /&gt;* moved IllegalStateError to AS3Commons-Lang&lt;br /&gt;* removed RuntimeError&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc&lt;br /&gt;* added "factoryObjectName" property to IObjectDefinition and ObjectDefinition&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory&lt;br /&gt;* added ObjectDefinitionStoreError&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.config&lt;br /&gt;* added StageComponentInterceptionPostProcessor&lt;br /&gt;* fixed e4x query to select nodes with Required metadata in RequiredMetadataObjectPostProcessor&lt;br /&gt;* changed "getObject" and "getObjectType" so we can also return Function references from methods in FieldRetrievingFactoryObject&lt;br /&gt;* added "getObjectDefinition" in IConfigurableListableObjectFactory&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.config.flex&lt;br /&gt;* added ApplicationPropertiesResolver&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.support&lt;br /&gt;* removed "allowObjectDefinitionOverriding" getter and setter from IObjectDefinitionRegistry&lt;br /&gt;* error is now thrown when overriding an object definition while it is not allowed in DefaultListableObjectFactory&lt;br /&gt;* added support for retrieving factory objects and autowiring in AbstractObjectFactory&lt;br /&gt;* added ObjectDefinitionBuilder&lt;br /&gt;* fixed bug with caching of factory objects in AbstractObjectFactory&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.xml&lt;br /&gt;* added StageInterceptionNamespaceHandler&lt;br /&gt;* added spring-actionscript-stageinterception-1.0.xsd&lt;br /&gt;* added spring_actionscript_stageinterception namespace&lt;br /&gt;* added RPCNamespaceHandler&lt;br /&gt;* added spring-actionscript-rpc-1.0.xsd&lt;br /&gt;* added spring_actionscript_rpc namespace&lt;br /&gt;* added UtilNamespaceHandler&lt;br /&gt;* added spring-actionscript-util-1.0.xsd&lt;br /&gt;* added spring_actionscript_util namespace&lt;br /&gt;* added MessagingNamespaceHandler&lt;br /&gt;* added spring-actionscript-messaging-1.0.xsd&lt;br /&gt;* added spring_actionscript_messaging namespace&lt;br /&gt;* added "resolveID" to AbstractObjectDefinitionParser method that allow object name lookup and generation&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.xml.parser.support&lt;br /&gt;* fixed XMLObjectDefinitionsParser so that abstract definitions are no longer parsed&lt;br /&gt;* fixed XMLObjectDefinitionsParser to support nested custom nodes&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers&lt;br /&gt;* fixed ObjectNodeParser to support nested custom nodes&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.xml.parser.support.nodeparsers.stageinterception&lt;br /&gt;* added StageInterceptorNodeParser&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.ioc.factory.xml.preprocessors&lt;br /&gt;* fixed parent properties not being overridden by child properties in ParentAttributePreprocessor&lt;br /&gt;* fixed bug with properties replacement&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.mvcs&lt;br /&gt;* removed AbstractService&lt;br /&gt;* added IApplicationController&lt;br /&gt;* added AbstractApplicationController&lt;br /&gt;* added ApplicationEvent&lt;br /&gt;* added ApplicationEventDispatcher&lt;br /&gt;* added IApplicationEventListener&lt;br /&gt;&lt;br /&gt;Package org.springextensions.actionscript.utils&lt;br /&gt;* added ApplicationUtils&lt;br /&gt;* moved ArrayUtils to AS3Commons-Lang&lt;br /&gt;* moved Assert to AS3Commons-Lang&lt;br /&gt;* moved DictionaryUtils to AS3Commons-Lang&lt;br /&gt;* moved ObjectUtils to AS3Commons-Lang&lt;br /&gt;* moved StringUtils to AS3Commons-Lang&lt;br /&gt;* moved XMLUtils to AS3Commons-Lang&lt;br /&gt;* removed TypedProxy&lt;br /&gt;&lt;br /&gt;Samples&lt;br /&gt;* added object-definition-parser-builder project&lt;br /&gt;&lt;br /&gt;Go get it while its hot!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-3089851387320438112?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/3089851387320438112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/07/spring-actionscript-version-08-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3089851387320438112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/3089851387320438112'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/07/spring-actionscript-version-08-released.html' title='Spring Actionscript version 0.8 released!'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-400814504313424055</id><published>2009-05-31T09:17:00.000-07:00</published><updated>2009-05-31T09:19:34.753-07:00</updated><title type='text'>as3commons v1.0 released</title><content type='html'>Just a quicky,  as3commons version 1.0 has just been released, check it out here:&lt;br /&gt;&lt;br /&gt;&lt;a target="_blank" rel="nofollow" href="http://www.as3commons.org/"&gt;http://www.as3commons.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;AS3Commons contains so far:&lt;br /&gt;&lt;br /&gt;Reflect:&lt;br /&gt;AS3Commons-reflect is an open-source library providing a reflection API for                  ActionScript 3.0. Being a pure actionscript library it can be used for any                 Flash/Flex/AIR project.            &lt;br /&gt;&lt;br /&gt;Logging:&lt;br /&gt;AS3Commons-logging is an open-source library providing an abstraction over                  logging framework implementations. Being a pure actionscript library it can                  be used for any Flash/Flex/AIR project. Its use is recommended for use                 with other libraries/framework trying to be logging framework agnostic.            &lt;br /&gt;&lt;br /&gt;Go and check it out!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-400814504313424055?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/400814504313424055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/05/as3commons-v10-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/400814504313424055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/400814504313424055'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/05/as3commons-v10-released.html' title='as3commons v1.0 released'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-1420578793564164250</id><published>2009-04-30T03:30:00.000-07:00</published><updated>2009-05-03T02:30:49.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript cairngorm flex convention based programming'/><title type='text'>Spring Actionscript + Cairngorm + Convention based coding == Less configuration</title><content type='html'>Spring Actionscript and its Cairngorm extensions provides you with a really nice way of configuring your events, command and delegates. Coupled with its AbstractCommandFactory it also makes your life very easy when it comes to injecting your commands and delegates with all sorts of properties.&lt;br /&gt;It does, however, lead to quite a lot of configuration markup which, in turn, means a lot of typing for you, the developer.&lt;br /&gt;&lt;br /&gt;Let's see if we can cut down on the amount of markup by using a little bit of convention based coding, a post processor and the new auto wiring functionality in Spring Actionscript.&lt;br /&gt;&lt;br /&gt;Mind you, the new autowiring capabilities will be implemented in version 0.8 of Spring Actionscript, which isn't officialy released yet. So, to use these new features, you'll have to get the source form the &lt;a href="https://src.springframework.org/svn/se-springactionscript-as"&gt;SVN repository&lt;/a&gt; directly and compile your own version.&lt;br /&gt;In my examples I also use the AS3Commons-Reflect library for a bit of reflection, you can find the lib here:&lt;br /&gt;&lt;a href="http://www.as3commons.org/as3-commons-reflect/index.html"&gt;AS3-Reflect&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Let's first define the naming convention for events, commands and delegates, in my example I use this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;namespace&amp;gt;.events.&amp;lt;identifier&amp;gt;Event&lt;br /&gt;&amp;lt;namespace&amp;gt;.commands.&amp;lt;identifier&amp;gt;Command&lt;br /&gt;&amp;lt;namespace&amp;gt;.delegates.&amp;lt;identifier&amp;gt;Delegate&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If I'm going to use the example of a GetProducts gesture the naming of the classes would then be, for example:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;com.classes.cairngorm.&lt;strong&gt;events&lt;/strong&gt;.GetProducts&lt;strong&gt;Event&lt;/strong&gt;&lt;br /&gt;com.classes.cairngorm.&lt;strong&gt;commands&lt;/strong&gt;.GetProducts&lt;strong&gt;Command&lt;/strong&gt;&lt;br /&gt;com.classes.cairngorm.&lt;strong&gt;delegates&lt;/strong&gt;.GetProducts&lt;strong&gt;Delegate&lt;/strong&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Let's start coding immediately.&lt;br /&gt;The event class would be very straight-forward:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;public class GetProductsEvent extends CairngormEvent&lt;br /&gt;{&lt;br /&gt;public static const EVENT_ID:String = &lt;strong&gt;"com.classes.cairngorm.events.GetProductsEvent"&lt;/strong&gt;;&lt;br /&gt;&lt;br /&gt;public function GetProductsEvent()&lt;br /&gt;{&lt;br /&gt; super(EVENT_ID);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;i&gt;Do notice that I use the fully qualified classname of the event class as its ID though, this will be used later on when we associate the event with its corresponding command.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Normally we would configure our frontcontroller in the Spring Actionscript markup like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;object id="frontController" class="org.springextensions.actionscript.cairngorm.control.CairngormFrontController" singleton="true"&amp;gt;&lt;br /&gt;&amp;lt;constructor-arg&amp;gt;&lt;br /&gt; &amp;lt;object&amp;gt;&lt;br /&gt;   &amp;lt;property name="com.classes.cairngorm.events.GetProductsEvent"&lt;br /&gt;     value="com.classes.cairngorm.commands.GetProductsCommand"/&amp;gt;&lt;br /&gt;&amp;lt;/constructor-arg&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;But not this time, we only create an 'empty' frontcontroller, like so:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;object id="frontController" class="org.springextensions.actionscript.cairngorm.control.CairngormFrontController"/&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Instead, we create an &lt;span style="font-weight: bold;"&gt;IObjectPostProcessor&lt;/span&gt; implementation that creates the event/command object mapping &lt;i&gt;for&lt;/i&gt; us, based on our naming convention.&lt;br /&gt;Any &lt;span style="font-weight: bold;"&gt;IObjectPostProcessor&lt;/span&gt; that is declared in the Spring Actionscript configuration will automatically be called for every object that is instantiated by the Spring AS container. So also for our FrontController. Here's how such an &lt;span style="font-weight: bold;"&gt;IObjectPostProcessor&lt;/span&gt; can be used to configure your frontcontroller automatically:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;public class FrontControllerPostprocessor extends Object implements IObjectPostProcessor&lt;br /&gt;{&lt;br /&gt;public function FrontControllerPostprocessor()&lt;br /&gt;{&lt;br /&gt; super();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private var _eventIds:Array;&lt;br /&gt;&lt;i&gt;//this is an array of event id strings:&lt;/i&gt;&lt;br /&gt;public function set eventIds(value:Array):void&lt;br /&gt;{&lt;br /&gt; _eventIds = value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//we won't do anything before the command is initialized, so just return null here&lt;/i&gt;&lt;br /&gt;public function postProcessBeforeInitialization(object:*, objectName:String):*&lt;br /&gt;{&lt;br /&gt; return null;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//After the object has been initialised, check if the current object is an instance&lt;/i&gt;&lt;br /&gt;&lt;i&gt;//of CairngormFrontController. If so, perform the configuration:&lt;/i&gt;&lt;br /&gt;public function postProcessAfterInitialization(object:*, objectName:String):*&lt;br /&gt;{&lt;br /&gt; var frontController:CairngormFrontController = (object as CairngormFrontController);&lt;br /&gt; if (frontController != null)&lt;br /&gt; {&lt;br /&gt;   frontController.commandMap = createCommandMap();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//Loop through the event id list and generate a valid command class based on each ID:&lt;/i&gt;&lt;br /&gt;private function createCommandMap():Object&lt;br /&gt;{&lt;br /&gt; var commandMap:Object = {};&lt;br /&gt; if (_eventIds != null)&lt;br /&gt; {&lt;br /&gt;   _eventIds.forEach(function(item:String,index:int,arr:Array):void&lt;br /&gt;     {&lt;br /&gt;       commandMap[item] = createCommandClass(item);&lt;br /&gt;     });&lt;br /&gt; }&lt;br /&gt; return commandMap;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;//Generate a class name for the specified eventId  &lt;/i&gt;&lt;br /&gt;private function createCommandClass(eventId:String):String&lt;br /&gt;{&lt;br /&gt; &lt;i&gt;//The event id is the same as its fully qualified classname, like this:&lt;/i&gt;&lt;br /&gt; &lt;i&gt;//com.classes.cairngorm.events.GetProductsEvent&lt;/i&gt;&lt;br /&gt; &lt;i&gt;//therefore we split the path on its period character:&lt;/i&gt;&lt;br /&gt; var parts:Array = eventId.split('.');&lt;br /&gt; &lt;i&gt;//the last element of the resulting array will be the eventname, this we&lt;/i&gt;&lt;br /&gt; &lt;i&gt;//want to keep for now:&lt;/i&gt;&lt;br /&gt; var eventName:String = String(parts.pop());&lt;br /&gt; &lt;i&gt;//the next element is the 'events' part, let's get rid of this:&lt;/i&gt;&lt;br /&gt; parts.pop();&lt;br /&gt; &lt;i&gt;//finally, we join back to the first part of the path, add the 'commands'&lt;/i&gt;&lt;br /&gt; &lt;i&gt;//part and replace the 'Event' part of the eventid with 'Command'&lt;/i&gt;&lt;br /&gt; &lt;i&gt;// and we end up with a valid command class:&lt;/i&gt;&lt;br /&gt; &lt;i&gt;//com.classes.cairngorm.commands.GetProductsCommand&lt;/i&gt;&lt;br /&gt; return parts.join('.') + '.commands.' + eventName.replace('Event','Command');&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;That takes care of our frontcontroller, it now knows which command to create for which event, wonderful!&lt;br /&gt;&lt;br /&gt;Now, our command will need a reference to the application model (because I'm pretty sure we will want the result of our GetProducts call to end up in the model, right?), for this we will make an interface called &lt;strong&gt;IModelLocatorAware&lt;/strong&gt;. Its signature is very simple:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;public interface IModelLocatorAware&lt;br /&gt;{&lt;br /&gt;function set modelInstance(value:IModelLocator):void;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And thusly, our &lt;span style="font-weight: bold;"&gt;GetProductsCommand&lt;/span&gt;'s implementation will look like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;public class GetProductsCommand extends AbstractResponderCommand implements IModelLocatorAware&lt;br /&gt;{&lt;br /&gt;public function GetProductsCommand()&lt;br /&gt;{&lt;br /&gt; super();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function execute(event:CairngormEvent):void&lt;br /&gt;{&lt;br /&gt; &lt;span style="font-style: italic;"&gt;//extra logic goes here...&lt;/span&gt;&lt;br /&gt; GetProductsDelegate(businessDelegate).getProducts();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private var _modelInstance:IModelLocator;&lt;br /&gt;public function set modelInstance(value:IModelLocator):void&lt;br /&gt;{&lt;br /&gt; _modelInstance = value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function result(data:Object):void&lt;br /&gt;{&lt;br /&gt; var resultEvent:ResultEvent = data as ResultEvent;&lt;br /&gt; &lt;span style="font-style: italic;"&gt;//extra logic goes here...&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;override public function fault(info:Object):void&lt;br /&gt;{&lt;br /&gt; var faultEvent:FaultEvent = info as FaultEvent;&lt;br /&gt; &lt;span style="font-style: italic;"&gt;//extra logic goes here...&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;As you see, in the execute method, this command expects its &lt;strong&gt;businessDelegate&lt;/strong&gt; instance to be of type &lt;strong&gt;GetProductsDelegate&lt;/strong&gt;.&lt;br /&gt;We want to make sure that such a delegate has been injected into our command instance.&lt;br /&gt;For this we will create a command factory. Spring Actionscript's CairngormFrontController allows us to add &lt;strong&gt;ICommandFactory&lt;/strong&gt; instances that take care of the creation of certain classes of commands.&lt;br /&gt;What we want is a factory that not only creates the right command, but also injects it with a reference to the application model &lt;i&gt;and&lt;/i&gt; the right business delegate instance.&lt;br /&gt;It doesn't take that much code, check out this command factory:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;public class AutowiringCommandFactory implements ICommandFactory, IApplicationContextAware&lt;br /&gt;{&lt;br /&gt;public function AutowiringCommandFactory()&lt;br /&gt;{&lt;br /&gt; super();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//this factory implements the IApplicationContextAware interface, which means it&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //will automatically be injected with the IApplicationContext instance that&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //created it. We will use the IApplicationContext to perform the autowiring.&lt;/span&gt;&lt;br /&gt;private var _applicationContext:IApplicationContext;&lt;br /&gt;public function set applicationContext(value:IApplicationContext):void&lt;br /&gt;{&lt;br /&gt; _applicationContext = value;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//In this example we will be arrogant and claim we are able to create any&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //command possible:&lt;/span&gt;&lt;br /&gt;public function canCreate(clazz:Class):Boolean&lt;br /&gt;{&lt;br /&gt; return true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//And here we actually create the reuqested class and inject it with the&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //appropriate instances&lt;/span&gt;&lt;br /&gt;public function createCommand(clazz:Class):ICommand&lt;br /&gt;{&lt;br /&gt; &lt;span style="font-style: italic;"&gt;//First we retrieve the fully qualified classname and create an&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   //IObjectDefinition instance based on this classname. We then&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   //set the autowiring mode to 'byName' and let the IApplicationContext&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   //inject any properties that are defined in the container by name.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;   //(in our case the ModelLocator instance)&lt;/span&gt;&lt;br /&gt; var className:String = Type.forClass(clazz).fullName;&lt;br /&gt; var objectDefinition:IObjectDefinition = new ObjectDefinition(className);&lt;br /&gt; objectDefinition.isSingleton = false;&lt;br /&gt; objectDefinition.autoWireMode = ObjectDefinitionAutowire.AUTOWIRE_BYNAME;&lt;br /&gt; var command:AbstractResponderCommand = new clazz() as AbstractResponderCommand;&lt;br /&gt; _applicationContext.wire(command,objectDefinition);&lt;br /&gt; &lt;span style="font-style: italic;"&gt;//Then we create a business delegate based on the naming convention of our command classname:&lt;/span&gt;&lt;br /&gt; var delegate:IBusinessDelegate = createBusinessDelegate(className);&lt;br /&gt; delegate.responder = command;&lt;br /&gt; command.businessDelegate = delegate;&lt;br /&gt; return command;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//Assemble the business delegate class name, much in thew same way as we assembled the&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; //command class name based on the event ID:&lt;/span&gt;&lt;br /&gt;private function createBusinessDelegate(commandClassName:String):IBusinessDelegate&lt;br /&gt;{&lt;br /&gt; var parts:Array = commandClassName.replace('::','.').split('.');&lt;br /&gt; var delegateName:String = String(parts.pop());&lt;br /&gt; parts.pop();&lt;br /&gt; var businessDelegateName:String = parts.join('.') + '.delegates.' + delegateName.replace('Command','Delegate');&lt;br /&gt; var cls:Class = (getDefinitionByName(businessDelegateName) as Class);&lt;br /&gt; //com.classes.cairngorm.delegates.GetProductsDelegate&lt;br /&gt; return new cls() as IBusinessDelegate;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;So, now all we really need is the final Spring Actionscript configuration to tie this all together:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;objects&amp;gt;&lt;br /&gt;&amp;lt;!-- The application model instance: --&amp;gt;&lt;br /&gt;&amp;lt;object id="modelInstance" class="com.classes.cairngorm.model.ModelLocator" singleton="true"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- The empty frontcontroller instance, injected with the AutowiringCommandFactory instance&lt;br /&gt;    which will create the configured commands: --&amp;gt;&lt;br /&gt;&amp;lt;object id="frontController" class="org.springextensions.actionscript.cairngorm.control.CairngormFrontController"&amp;gt;&lt;br /&gt; &amp;lt;method-invocation name="addCommandFactory"&amp;gt;&lt;br /&gt;   &amp;lt;arg&amp;gt;&lt;br /&gt;     &amp;lt;object class="com.classes.cairngorm.commands.factory.AutowiringCommandFactory"/&amp;gt;&lt;br /&gt;   &amp;lt;/arg&amp;gt;&lt;br /&gt; &amp;lt;/method-invocation&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- The post processor that will configure the frontcontroller, when new event/command/delegates are added&lt;br /&gt;    all you need to do is only add the event id to the specified array, the wiring will be done automatically&lt;br /&gt;    after that:&lt;br /&gt;--&amp;gt;&lt;br /&gt;&amp;lt;object id="frontControllerPostProcessor" class="com.classes.spring.postprocessors.FrontControllerPostprocessor"&amp;gt;&lt;br /&gt; &amp;lt;property name="eventIds"&amp;gt;&lt;br /&gt;   &amp;lt;value&amp;gt;&lt;br /&gt;     &amp;lt;array&amp;gt;&lt;br /&gt;       &amp;lt;value&amp;gt;com.classes.cairngorm.events.GetProductsEvent&amp;lt;/value&amp;gt;&lt;br /&gt;     &amp;lt;/array&amp;gt;&lt;br /&gt;   &amp;lt;/value&amp;gt;&lt;br /&gt; &amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&amp;lt;/objects&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;And that's it! With only the power of autowiring, post processing and a little bit of 'convention over configuration' we slimmed down our configuration markup considerably!&lt;br /&gt;&lt;br /&gt;Of course, its debatable whether such an approach would be recommended in a large application with many, many events and commands. It does save a bunch of time typing out the markup but may make your overal source a little harder to understand for newcomers to the project.&lt;br /&gt;This is a matter of preference I suppose, there's a case for and against it, I believe with proper project documentation this would be a viable solution. But it certainly isn't appropriate for every occasion, I admit.&lt;br /&gt;&lt;br /&gt;I hope however, that this post does shine a little bit of light on the new autowiring capabilities of Spring Actionscript and may introduce some people to the wonderful world of the &lt;span style="font-weight: bold;"&gt;IObjectPostprocessor &lt;/span&gt;:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-1420578793564164250?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/1420578793564164250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/04/spring-actionscript-cairngorm.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/1420578793564164250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/1420578793564164250'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/04/spring-actionscript-cairngorm.html' title='Spring Actionscript + Cairngorm + Convention based coding == Less configuration'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-5063384914297257546</id><published>2009-02-05T04:20:00.000-08:00</published><updated>2009-02-05T06:39:10.054-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex XML bug whitespace'/><title type='text'>Whitespace frustrations</title><content type='html'>&lt;blockquote&gt;&lt;br /&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;So, I got it to work eventually. Apparently if I also set this property:&lt;br /&gt;&lt;strong&gt;XML.prettyPrinting = false&lt;/strong&gt;;&lt;br /&gt;I get the expected results. Not pretty at all, but at least it solved my problem for now...&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;I'm making this little Flex proof-of-technique application currently that deals with quite a bit of XML.&lt;br /&gt;One of the first things I encountered was that an element looking like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;node&amp;gt;text with trailing whitespace &amp;lt;/node&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The text of this node ended up in my object as 'text with trailing whitespace'. So *without* the trailing space, which was essential to DO end up there.&lt;br /&gt;&lt;br /&gt;Well, a quick google turned out that before I parse my incoming XML I should add this line of code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;XML.ignoreWhitespace = false;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;And then create my XML object.&lt;br /&gt;&lt;br /&gt;On a side note, I think its kind of weird to set such a parameter through a static property. In my opinion it would have made more sense to just add a constructor argument which defaults to true, sort of like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;var ignorewhitespace:Boolean = false;&lt;br /&gt;var xmlObject:XML = new XML(BigFrakkingXMLString,ignorewhitespace);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;But, unfortunately my problems weren't over.&lt;br /&gt;On my way back to the server I'm supposed to create an XML object and send this.&lt;br /&gt;So, what do I do? I set the static property: XML.ignoreWhitespace = false;&lt;br /&gt;And I start creating elements and adding them to my XML object.&lt;br /&gt;For example, I add an element like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;var contentXML:XML = new XML("&amp;lt;Content&amp;gt;" + someStringOfText + "&amp;lt;/Content&amp;gt;");&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;where the someStringOfText string has a value of, for example, "some text with a trailing space again ".&lt;br /&gt;&lt;br /&gt;Yet, somehow the element ends up looking like this:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&amp;lt;Content&amp;gt;some text with a trailing space again&amp;lt;/Content&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;So, am I dealing with a bug here, or am I doing something fundamentally wrong here again?&lt;br /&gt;&lt;br /&gt;I guess an option would be to just send value objects back to the server and handle all of the XML creation there. But I'm sort of buggered by the fact that I seem to hit a wall here over such a small little issue...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-5063384914297257546?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/5063384914297257546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/02/whitespace-frustrations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5063384914297257546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/5063384914297257546'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/02/whitespace-frustrations.html' title='Whitespace frustrations'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-6870271356801159088</id><published>2009-01-23T00:32:00.001-08:00</published><updated>2009-01-23T00:52:29.822-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='spring actionscript include class compile'/><title type='text'>Different ways of forcing Flex to compile a class</title><content type='html'>As a user of &lt;a href="http://forum.springsource.org/forumdisplay.php?f=60"&gt;Spring Actionscript&lt;/a&gt; I have, of course, run into the problem of classes not being compiled into the swf file.&lt;br /&gt;&lt;br /&gt;When you have defined an object in the Spring AS configuration, but there's not direct reference in your source code to the class, the Flex compiler will optimize the class out of the swf and you end up with runtime errors such as this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;a class with the name 'x.y.z' could not be found&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So far I know of three different ways to tackle this problem:&lt;br /&gt;&lt;br /&gt;1. Add dummy variables in your source code like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;privare var _dummy1:MyClass;&lt;br /&gt;privare var _dummy2:MyOtherClass;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;2. Add a Frame tag for each class you want to be included to one dummy class, and include only that dummy class. Code would look like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.myclasses&lt;br /&gt;{&lt;br /&gt;   [Frame(extraClass="com.myclasses.MyClass")]&lt;br /&gt;   [Frame(extraClass="com.myclasses.MyOtherClass")]&lt;br /&gt;   public class MyDummyClass&lt;br /&gt;   {&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;3. Use a bit of XSLT, an ANT script and add this a builder in FlexBuilder. I have posted a PDF with a how-to on the springsource forums over here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forum.springsource.org/showthread.php?p=218017#post218017"&gt;Spring Actionscript forum post&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hopefully in the future there will be a more elegant way of forcing certain classes to be included, but until then, pick one of these solutions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-6870271356801159088?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/6870271356801159088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/01/different-ways-of-forcing-flex-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/6870271356801159088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/6870271356801159088'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/01/different-ways-of-forcing-flex-to.html' title='Different ways of forcing Flex to compile a class'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-2575135917788284776</id><published>2009-01-14T12:53:00.000-08:00</published><updated>2009-01-23T00:55:23.028-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex actionscript undo history opensource'/><title type='text'>Introducing: As3UndoHistory</title><content type='html'>Ok, so I've released a first version of my little undohistory lib on google code,&lt;br /&gt;go and get it here:&lt;br /&gt;&lt;a href="http://code.google.com/p/as3undohistory/"&gt;as3undohistory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can pull the sources right from the SVN repository there. So far I haven't made a release package because the whole thing's fairly small anyways.&lt;br /&gt;&lt;br /&gt;There's three projects in the repository, the actual library, a unit test project and an example application which showcases what the library actually does.&lt;br /&gt;&lt;br /&gt;I have no idea how well the library scales, I guess registering a few thousand objects with each 50 properties and then changing each property say 200 times will eventually eat a bunch of memory. It might be worth a stress test at some point. But on the other hand, I wouldn't know how to record changes in a different way than this. But then again, I'm just a bonehead, so if anyone has a better approach to this kind of edit history recording, I'd love to hear it.&lt;br /&gt;&lt;br /&gt;I'll be working on the documentation some more this evening I guess because, right now, its almost non-existent. Should anybody be interested in using the library, go ahead and please give me a yell should you find any bugs.&lt;br /&gt;&lt;br /&gt;Cheers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-2575135917788284776?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/2575135917788284776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/01/introducing-as3undohistory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2575135917788284776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2575135917788284776'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/01/introducing-as3undohistory.html' title='Introducing: As3UndoHistory'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8263529019533665919.post-2262288029170180749</id><published>2009-01-13T02:41:00.000-08:00</published><updated>2009-01-23T00:54:57.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex actionscript undo history'/><title type='text'>undo history management in Flex</title><content type='html'>So I have a major flu which puts me in bed bored out of my skull...&lt;br /&gt;I have this ongoing project, a Flex application, which is basically a sort of mind mapping system crossed with a drawing application. Now one of the next feature requests that the client made is an &lt;span style="font-style: italic;"&gt;undo history&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Yikez.&lt;br /&gt;&lt;br /&gt;So, I've been toying around with how to do it, and came up with, what I think, is a workable solution. I don't follow the usual command pattern which you find in most google searches on flex + undo history. What I basically needed was a recording of all the property changes on a bunch of objects.&lt;br /&gt;I.e. property color was set to #00000, property width was set to 150, etc, etc.&lt;br /&gt;These changes have to be recorded chronologically and undoing would basically be a matter of popping entries off a stack.&lt;br /&gt;&lt;br /&gt;So, my solution makes use of some metadata and requires the objects that will be monitored to implement their properties with getters and setters.&lt;br /&gt;An undoable property would look something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[Undoable]&lt;br /&gt;public function get testStringProperty():String&lt;br /&gt;{&lt;br /&gt;   return _testStringProperty;&lt;br /&gt;}&lt;br /&gt;[Bindable(event="testStringPropertyChanged")]&lt;br /&gt;public function set testStringProperty(value:String):void&lt;br /&gt;{&lt;br /&gt;   if (value != _testStringProperty)&lt;br /&gt;   {&lt;br /&gt;       _testStringProperty = value;&lt;br /&gt;       dispatchEvent(new Event("testStringPropertyChanged"));&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The object that implements this property needs to be registered once with a history manager class which analyzes the metadata and sets up eventlisteners,etc. In my implementation I use Christophe Herremans &lt;a href="http://as3reflect.googlecode.com/"&gt;as3reflect&lt;/a&gt; library for retrieving the metadata.&lt;br /&gt;&lt;br /&gt;My undo history manager also supports simple transactions, in the case several property changes represent only one user gesture. This is simply a matter of calling startTransaction and endTransaction on the history manager.&lt;br /&gt;&lt;br /&gt;Anyways, I'm still busy cleaning up the code, finishing the documentation and making a little example application. But when I'm finished I'll release this on google code so maybe somebody else can benefit from this as well.&lt;br /&gt;&lt;br /&gt;Or maybe someone on the interwebs thinks my solution is absolutely ridiculous, then I'd like to hear about it too :)&lt;br /&gt;&lt;br /&gt;For now, I'm going back to being sick with the flu.&lt;br /&gt;&lt;br /&gt;Cheers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8263529019533665919-2262288029170180749?l=zwaga.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zwaga.blogspot.com/feeds/2262288029170180749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zwaga.blogspot.com/2009/01/undo-history-management-in-flex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2262288029170180749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8263529019533665919/posts/default/2262288029170180749'/><link rel='alternate' type='text/html' href='http://zwaga.blogspot.com/2009/01/undo-history-management-in-flex.html' title='undo history management in Flex'/><author><name>Roland Zwaga</name><uri>https://profiles.google.com/113870076147426639803</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-lj5UHZD10XQ/AAAAAAAAAAI/AAAAAAAAAAA/RsLDjs3bPwo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
