Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Triggering a Robotlegs Command via a Signal
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Joel Hooks  
View profile  
 More options Jan 16 2010, 2:32 pm
From: Joel Hooks <joelho...@gmail.com>
Date: Sat, 16 Jan 2010 11:32:12 -0800 (PST)
Local: Sat, Jan 16 2010 2:32 pm
Subject: Triggering a Robotlegs Command via a Signal
I'm a bit stuck on this bit. I want to use a command, but I can't
grasp how to map a command to a signal. Is that even possible right
now? NativeSignal?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Penner  
View profile  
 More options Jan 16 2010, 6:35 pm
From: Robert Penner <i...@robertpenner.com>
Date: Sat, 16 Jan 2010 15:35:08 -0800
Local: Sat, Jan 16 2010 6:35 pm
Subject: Re: [as3-signals] Triggering a Robotlegs Command via a Signal
What the command really needs is the value object. Wrapping the VO in
a custom Event is boilerplate required by EventDispatcher.

A Signal is essentially a dispatcher--one that can send your value
object without wrapping it in an Event. So you wouldn't map between
the Signal and the command. You'd map between the VO and the command.

How that mapping is defined is an interesting question. If each VO
class had only one relevant command, you could map VO class to command
class easily. However, if there are multiple commands, how do you
route the VO to the desired one? In Robotlegs' CommandMap, Event.type
is the router. But because Signals are so flexible, they don't impose
a convention like Event.type.

You can still dispatch Event instances through a Signal if you like.
The only issue is that the .target and .currentTarget won't be set;
only EventDispatcher can change those.

I'm glad you brought this up. I don't have answers yet but you've got
me thinking about it. It's probably a puzzle you'll end up solving,
and I'm happy to provide information on how to use Signals.

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Hooks  
View profile  
 More options Jan 16 2010, 6:52 pm
From: Joel Hooks <joelho...@gmail.com>
Date: Sat, 16 Jan 2010 17:52:51 -0600
Local: Sat, Jan 16 2010 6:52 pm
Subject: Re: [as3-signals] Triggering a Robotlegs Command via a Signal
My first inclination is a SignalCommandMap to map typed Signals to
executable commands.

signalCommandMap.mapSignal(MySignal, SomeCommand);

I dig commands in that they are such a nice way to encapsulate
business logic.

On Jan 16, 2010, at 5:35 PM, Robert Penner <i...@robertpenner.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Penner  
View profile  
 More options Jan 16 2010, 7:58 pm
From: Robert Penner <i...@robertpenner.com>
Date: Sat, 16 Jan 2010 16:58:11 -0800
Local: Sat, Jan 16 2010 7:58 pm
Subject: Re: [as3-signals] Triggering a Robotlegs Command via a Signal
Ok, I just finished reading through your blog post:

http://joelhooks.com/2010/01/16/robotlegs-image-gallery-example-using...

What you've done with Signals is really creative and
thought-provoking, akin to Richard Lord's example:

http://www.richardlord.net/blog/flexcaster-smartysignals

In December, I briefly thought, "What about injecting Signals in my
Robotlegs app?" But I dismissed the idea because I was using normal
Signals and I didn't want to create named injections for them. I
didn't think of using Signal subclasses to solve this, which you did.

This month, I've been using a few Signals to communicate between
Mediators and was wondering if I should make a "SignalBus". It could
be merely a place to store Signals that bridge between application
actors.

But what you're doing is storing Signal subclasses in the Robotlegs
Injector. Then you inject them wherever needed. It's like you exploded
the Context EventDispatcher and its shrapnel is embedded all over the
place (in a good way).

Ok, here's something that may help you with mapping Signals to commands:

public interface ISignal
{
        /**
         * An optional array of classes defining the types of parameters sent
to listeners.
         */
        function get valueClasses():Array;

Man, I wish we had generics.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Hooks  
View profile  
 More options Jan 16 2010, 8:28 pm
From: Joel Hooks <joelho...@gmail.com>
Date: Sat, 16 Jan 2010 19:28:11 -0600
Local: Sat, Jan 16 2010 8:28 pm
Subject: Re: [as3-signals] Triggering a Robotlegs Command via a Signal
On Jan 16, 2010, at 6:58 PM, Robert Penner wrote:

>    function get valueClasses():Array;

Ya, I am passing in the value classes in the super() of my extensions.

http://github.com/joelhooks/robotlegs-examples-ImageGalleryPM/blob/ma...

It works really well.

I think a SignalCommandMap will be a really simple mechanism. I'm going to flesh it out tomorrow. Good times!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »