Robotlegs and AS3 Signals

samac1068's Avatar

samac1068

05 Jul, 2011 03:01 PM

I’ve read discussion after discussion, but in some cases the answer doesn’t make sense.

I believe I have a basic understanding of Robotlegs which has enabled me to produce several small projects successfully. I can’t be sure if I’m using the elements as initially designed because of the variances in the available examples on the web. Now I’m trying to incorporate Signals with Robotlegs and I’ve hit a wall. I understand signals and have created a few test application. I understand the how it works in those applications, but when I try to translate into a Robotlegs framework, I can’t seem to get my head wrapped around it.

I’ve download multiple examples for Robotlegs, uses either the Presentation model or the Pure MVCs model, which I more comfortable with. I’ve included the signal extension in my latest project, along with the latest version of Robotlegs and AS3 Signals. I was able to bootstrap my project to the context and now I’m trying to understand the changes in the context. I know I am mapping signals to command instead of events, but when I use the Signal Café example, I don’t understand why some signals are injected and others are mapped. There are other differences but I contribute that to style. Can someone get me out of the woods so I can add signals to my projects. I am using the Class Diagram.

  1. 1 Posted by Arturo on 11 Jul, 2011 06:45 PM

    Arturo's Avatar

    Have you looked at:
    http://joelhooks.com/2010/02/14/robotlegs-as3-signals-and-the-signa...

    Anyways, here is the "answer" to your question.

    Signals are "different" than Events. Signals are "objects".
    When using events, you subscribe a listener to the object that will either dispatch or transvers the event.
    Signals, on the other hand, are not part of the display list. You subscribe a listener to the signal itself.

    So you can have signals as part of any object or you can have signals as Objects that are managed by the framework, so they are not part of anything in particular.

    When you attach a signal to a SignalCommand, the framework itself creates a singleton of the signal automatically. You must inject that singleton in Mediators to have access to the singleton created by the framework.

    You can create signal singletons that are not attached to any command, if you wish to have mediators talk to each other, for example.

    Hope this helped.

  2. 2 Posted by Timur on 21 Jul, 2011 05:15 AM

    Timur's Avatar

    I downloaded the latest versions of swcs of RL, Signals, and signals-extension-SignalsCommandMap (v0.3 and v0.4) and if I update the libs of Joel's SignalCafe example project, it starts throwing an error.

    Has anyone a) used Joel's SignalCafe example with the latest swcs? and b) is the possible cause of this error in the SignalCafe project or one of the swcs?

    Tim

  3. 3 Posted by Stray on 21 Jul, 2011 08:06 AM

    Stray's Avatar

    Hi Tim - do you know what the error is?

    Signals isn't yet at 1.0 so the api and the way the interfaces are composited is in flux and has changed quite a lot between 0.7 and 0.8 - so generally things built with earlier versions of signals can't be updated just by dropping in a new swc/lib.

    Stray

  4. 4 Posted by Timur on 21 Jul, 2011 09:13 AM

    Timur's Avatar

    Hi Stray,

    Error: Injector is missing a rule to handle injection into target [object FoodItemSelectedCommand]. Target dependency: org.robotlegs.examples.signalcommands.model.vo::FoodItem
    at org.swiftsuspenders.injectionpoints::PropertyInjectionPoint/applyInjection()[/Users/tschneidereit/dev/swiftsuspenders/swiftsuspenders/src/org/swiftsuspenders/injectionpoints/PropertyInjectionPoint.as:42] at org.swiftsuspenders::Injector/injectInto()
    

    So, to use RL and Signals together, should I use robotlegs-framework-v1.0.3, signals v0.5.swc, and signals-extension-SignalsCommandMap.swc (option 1) or forgo signals-extension-SignalsCommandMap.swc and use the latest RL & Signals and use your SignalMediator (option 2)? I know it's an apples to oranges comparison, but I'd like to pick a few tools and begin carving out something that won't throw errors, if possible.

    Thanks again,

    Tim

  5. 5 Posted by Stray on 21 Jul, 2011 09:31 AM

    Stray's Avatar

    Hi Tim,

    Using the latest versions of all 4 should be fine. I expect it's a problem in the example code.

    We have tested Signals-0.8, Robotlegs 1.4, Swift-suspenders 1.6 and the latest version of SignalCommandMap together and there were no problems.

    https://github.com/stray/signals-extensions-CommandSignal

    The Signal - cafe example is most likely out of step with the way the interfaces have changed since then. It would still be worth dropping the latest builds of Robotlegs, Swift-suspenders, SignalCommandMap and Signals into that demo just to see if it runs ok, but it may not like that as the newer release of Signals has removed a couple of the old interfaces.

    I'd say use the latest versions - and shop around (there is a thread in Examples) for a more recent demo. I realise it's frustrating that the demos wind up out-of-date - limitations of time and resources.

    Stray

  6. 6 Posted by Timur on 21 Jul, 2011 09:39 AM

    Timur's Avatar

    Thanks Stray,

    OK, that's good to know. For the record, Joel's Signals Cafe demo worked fine with the swcs it came bundled with, it is only when I updated them with the most recent builds that it stopped working.

    Just to clarify, I could use both SignalCommandMap and the SignalMediator together in the same project, as they do different things, yes?

    I am armed to the teeth with the latest swcs now ;-)

    Tim

  7. 7 Posted by Stray on 21 Jul, 2011 09:53 AM

    Stray's Avatar

    Hi Tim, yes, signalMediator and signalCommandMap play nicely together - they both just pull in whatever version of Signals you're using.

    Good luck!

    Stray

  8. 8 Posted by samac1068 on 28 Sep, 2011 12:40 PM

    samac1068's Avatar

    Just a follow up, I had to use the source for robotlegs and signals (using the latest version of all) to get my signals to work properly. Not sure why, but working for me.

  9. samac1068 closed this discussion on 28 Sep, 2011 12:40 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac