With the release of the 1.0 Beta of the Swiz framework, I've updated my Swiz example application to the latest version. You can also view the source code if you like. I'd like to point out a few things that I had to change from the example based on version 0.6.4:
- The instantiation of the framework has changed in order to support multiple instances of Swiz, primarily for Flex module support:
<swiz:SwizConfig id="mySwizConfig" eventPackages="com.briankotek.swizdemo.event" viewPackages="com.briankotek.swizdemo.view" defaultFaultHandler="{genericFault}" /> <swiz:Swiz id="mySwiz" beanProviders="{[Beans]}" config="{mySwizConfig}" /> - The static methods on the Swiz class have been removed, due to the fact that there can now be multiple instances of Swiz. This means that instead of doing something like Swiz.dispatchEvent( event ), you now want to inject a dispatcher object into your non-view objects and dispatch events through it instead. The two main ways to do this are to inject the dispatcher in your BeanLoader/BeanProvider, or by having your class implement the IDispatcherAware interface, which will instruct Swiz to inject the dispatcher automatically.
- The [Autowire] metadata tag has been deprecated in favor of the more industry-standard [Inject]. [Autowire] will still work for now, but be aware that this may be removed in a future release.
- The use of the earlier CommandChain has changed to support more robust and extensible chains, as well as supporting internal Flex event-based chains on top of the existing support for chains that make server calls. For example:
var chain : CommandChain = new CommandChain();<br> chain.addMember( new AsyncChainStepCommand( delegate.deleteUser, [user], userDeleteHandler ) );<br> chain.addMember( new AsyncChainStepCommand( delegate.deleteUserProfileImage, [user], userProfileImageDeleteHandler ) );<br> chain.addEventListener( "chainComplete", userDeleteCompleteHandler, false, 0, true );<br> chain.start();
Comments (19) |
del.icio.us
|
Digg It!
|
Linking Blogs
| 630 Views


