Search code examples
robotlegsactionscript-3

AS3 Robot legs and Signals - Using Signals, Quite verbose, any alternatives?


Im using RobotLegs and Signals for my application. This is my first time using Robotlegs, and Im using Joel Hooks Signal Command Map example here

I've noticed that it seems quite verbose in contrast to events. For every Signal I have to create a new class, whereas with events I would group event types into one class.

I like how visually and instantly descriptive this is.. just browsing a signals package will reveal all app communications. Although it seems quite verbose to me.

Are other people using this, Is the way I'm using signals like this correct, or have people found a way around this verboseness?

Cheers


Solution

  • It's the correct way though. The major advantage of signals is you can include them in your interface definitions, but obviously you'll end up with a big pile of signals.

    In general I use signals only for my view->mediator and service->command communication (1-to-1). For system wide notifications I use events (n-to-n). It makes the number of signals a bit more manageable. But it's a matter of preference obviously.

    Using a good IDE and/or a templating system alleviates a lot of the "pain" of having to create the various signals.