Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AS3 Signals versus Events

 
Anup Francis
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Authors,
What is your opinion on using AS3 signals?
Do you think its a better idea to go with signals for creating new apps?
I haven't come across the use of signals in any of the places I have worked.
Only came to know recently about it.
I read up on it and it seems to be good. But seriously, do you guys see it being a used a lot with respect to
event based communication?
 
Dan Orlando
author
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I prefer the use of signals over events whenever possible because there's a considerable difference in terms of conserving resources among other things. I believe a deeper integration is still slated for Robotlegs in the not-to-distant future, and we're all pretty heavy advocates of Robotlegs as an architectural framework.
 
Joel Hooks
author
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anup Francis wrote:Authors,
What is your opinion on using AS3 signals?
Do you think its a better idea to go with signals for creating new apps?
I haven't come across the use of signals in any of the places I have worked.
Only came to know recently about it.
I read up on it and it seems to be good. But seriously, do you guys see it being a used a lot with respect to
event based communication?


I think Signals is an excellent solution to an obvious disfunction of events:

You can't express events via an interface

Signals allow you to observe messages emitted from a concrete instance through its interface. This is very powerful.

So when is it appropriate to use Signals? For me, I like to keep Signals on the application layer and don't use them as much in my visual components. When I am developing visual components I prefer them to follow standard Flash/Flex approaches. I use Signals in the Application tier in conjunction with Robotlegs (which has a lot of Signals support via plugin libraries and utilities).

This is my preference, but I know people that use Signals everywhere, including view components.

At the end of the day they are both Observer pattern implementations. Events are "normal" for Flash Platform development, and there is a lot to be said for that. Signals can allow for more expressive OOP, and there is a lot to be said for that as well. I use a mix with much success. Your mileage may vary ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic