Over 10 years of community discussion and knowledge are maintained here as a read-only archive. New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC
|
|
|
Show Posts
|
Pages: 1 ... 4 5 [6] 7 8
|
79
|
Announcements and General Discussion / Public Demos, Tools and Applications / Re: Notification Chaining Utility
|
on: October 15, 2008, 05:03:36
|
I noticed that the body and types weren't getting passed to the next command in the chain, again, this might be dealt with in the actions, but I thought I'ld post my fix here
public function nextAction(node:ChainNotifierNode=null):void { if(current >= listenersArray.length-1) return; current++; doSendNotification(current, node); } added a second, optional param to soSendNotification, the lastNode:
public function doSendNotification(index:int=0, lastNode:ChainNotifierNode=null):void { if(listenersArray.length == 0 || listenersArray.length < current) return; var node:ChainNotifierNode; var name:String = listenersArray[index]; //get node name node = chainAssocArray[ name ] as ChainNotifierNode; //get node if(lastNode == null){ sendNotification( node.notifySender, node.notifyBody, node.notifyType ); }else{ sendNotification( node.notifySender, lastNode.notifyBody, lastNode.notifyType ); } } I don't know how this will affect adding body and type in the addNode method, as I'm not doing that, just passing a body along the chain
cheers
|
|
|
81
|
Announcements and General Discussion / Public Demos, Tools and Applications / Re: Notification Chaining Utility
|
on: October 14, 2008, 03:13:08
|
here is a fix for the listNotificationInterests
override public function listNotificationInterests():Array { if(listenersArray.length == 0 ) return []; //nothing to do var chainName:String = null; if(paused == false) chainName = listenersArray[current]; var actionsAndListerners:Array = actionArray.concat(listenersArray); return actionsAndListerners; }
NB the change is here: var actionsAndListerners:Array = actionArray.concat(listenersArray);
I don't know how it effects the actions... I haven't looked at them.
also a feature request:
instead of this: chainNotifier.addNode(NotificationNames.INITIATE_ACTORS, NotificationNames.ACTOR_INITIATION_COMPLETE );
can we have this: chainNotifier.addNode(NotificationNames.INITIATE_ACTORS, InitActorsCommand, NotificationNames.ACTOR_INITIATION_COMPLETE );
the ChainNotifier registers the Commands with the facade (and removes them afterward?), which means that all the information is available in the one place.
cheers :)
|
|
|
85
|
Announcements and General Discussion / General Discussion / Re: top level Interface pakage for utilities
|
on: October 05, 2008, 11:22:26
|
I did think that it might be a bit difficult to standardise, and you are quite right it probably would end in debate. We are an opinionated lot
btw IEncodeable, I think is a java one, allowing recursive serialisation of collected value objects:
function encode():* function decode(data:*)
but there are other ones that do the same but with different names...
|
|
|
86
|
Announcements and General Discussion / General Discussion / top level Interface pakage for utilities
|
on: October 05, 2008, 08:53:31
|
Hi cliff just wondering what you thought of the idea of having some kind of top level interface package in the utilities package. I was thinking of future proofing issues... as in you have lots of people writing some great utils, and some way of promoting loose coupling between them would be great. I mean what happens if I want to use an existing util in one that I am writing, but don't want to couple it tightly to it, so they have to be used together. Also common interface like IFactories and IEncodeables could use the same interface throughout the utils package. this would of course need to be standardised and mediated. i hope this has made sense. what do ya think? 
|
|
|
|
|
|