I really like Swiz. It works great with Presentation Models. It generally just gets out of my way. I have been using the Swiz Command Map in lue of Mediating events for my last few projects. It is nice to have the logic broken down in to little single-purpose commands. The Services and PMs communicate to the Commands by dispatching an event on the global event dispatcher. The events are mapped to the commands in the Command Map.
The last bit of that kinda irks me. I don't like creating tons of events and mapping them to commands. I end up writing much more boiler-plate code then I would like. Creating the new event classes takes time. Writing the code to dispatch the events also takes time and space. It also can create some annoying stack traces when I have to dig back through events.
In a past life I used callbacks in lieu of the event system in Flash with pretty good success. It was kinda odd at the start, but then I got used to it. I also have been in love with AS3Signals for some time now, but have not used it much on Flex projects, just pure AS3 ones.
I set out to cut out the .events.* package from my recent standard architecture and replace them with Signals. One of my goals was to not just end up having to create
n number of Signal classes to replace the previous Event classes. I like what I ended up with so far. I dumped the Command Map entirely and replaced it with a Signal Map. I also got rid of all the custom events :).
The big loss is that I do not get strong typing for the properties I want to send along as the payload from the Service, or PM, to the Command like I did with Events. To be honest, however, I often just had the 2nd or 3rd params of my Events something like data:Object that I would just jam full of whatever data I wanted to send long .. because I was too lazy to make a new event. Maybe not even lazy; it just interrupted my flow.
Here is a test project I made that follows this pattern. You can see that I am playing around with the most efficient way to declare a Signal.
EDIT - this was crap. I deleted it and rewrote it.
https://github.com/jayfour000/IoC-Swiz-SignalMap/tree/master/src
https://github.com/jayfour000/swiz-extension-SignalCommandMap
https://github.com/jayfour000/swiz-examples-SwizSignalCommandLogin
Let me know what you think. Let me know if you see any issues with scaling, particularly compared to the Swiz Command Map.
I have heard that the Swiz Command Map creates a new instance of the command each time an event fires. I don't think that AS3Signals can do anything like that, I am also not sure of what impact that will have on memory in a large application if the commands are not garbage collected after they run .. or if I will run into race conditions or state issues. Thought on this?