Seth, I think you're looking for a way to notify multiple views/other
elements when a command is complete.

Cairngorm maps a single command to a single event. It doesn't prescribe much
about what to do when the event is done, but provides ViewLocator to find
the views you might need to update. 

I think you're possibly looking to formalize a listener list to broadcast to
for the onResult element of your command class. You could expose logic in
the front controller to allow views and other classes to listen for command
completion by command name, and then create a base command class, which
contains the listen/broadcast functionality, to derive your commands from.

I guess you could also include a broadcast for the execute, to allow for
pre-execution logic.

I've not personally run into a situation where I could use this (done
nothing big enough, yet :D), but I'm certain this could provide value.

Give it a go!

Sunny skies,
Robert

-----Original Message-----
From: Seth Voltz [mailto:[EMAIL PROTECTED] 
Sent: 01 April 2005 10:16 AM
To: Flex Coders
Subject: [flexcoders] New event manager


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey everyone,

So I'm considering writing an event handler slightly different than the 
one in cairngorm and wanted to make sure I can't already do it or that 
it doesn't already exist somewhere in a similar form.

So currently the way events work in cairngorm (at least the way I 
learned them and use them) is I broadcast an event from anywhere, it 
gets picked up by an event commander, passed through a delegator and on 
to a specific location, usually through the use of view helpers.

Now, this has been real handy for most stuff because all events passed 
only had one destination. Unfortunately, now my app is getting a bit 
more complicated and it has multiple things that need to know when 
something happens. The first solution to this was a "Login Handler" 
(which I'm going to release at some point... probably when I get the 
free time to package it up and document it properly.) which allows any 
class to register itself (either with calls to the static class or 
through a "LoginHelper" which is simply an MXML wrapper for those 
calls) and when the login managers "triggerLogin" function is called, 
it executes the "loginTriggered" function in all registered classes. 
The same goes for "triggerLogout" and "logoutTriggered" respectively.

So, to recap. I need a better event handler. I want to register classes 
with a master event manager which calls back to all classes when any 
class triggers the specified event. Is this already in existence? Is it 
already in Cairngorm? If not... I'll write it. :)

Thanks,
      Seth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFCTQNHsnBTlzgQQ28RAtn3AJ9SDu4/gAYecJr7W7BxmDr24/3McQCfZ+aP
c6D9nvE6LBOwPwHMsYX52Lk=
=+9qa
-----END PGP SIGNATURE-----



 
Yahoo! Groups Links



 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to