PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: trifox on November 18, 2009, 10:03:07



Title: Send Notification Queue ?
Post by: trifox on November 18, 2009, 10:03:07
hello,

i just wanted to let you know, that i use a modified "ApplicationFacade" always in my projects

the change i made has to do with the "sendNotification" functionality of the facade, i had often
the cases, that notifications were send BEFORE another notification has received all its receivers ...

so, i had to supress dispatching of new notifications while a notification is under work ...

this modification has been used in nearly all projects, and if i started a project without this
mod, after a few weeks errors occured because of that problem ...

in my opinion it would be good to define the sending of notifications somehow, either with a flag, or another base class for applicationfacade ...

just wanted to let ya know, i will continue using it

cheers
ck


Title: Re: Send Notification Queue ?
Post by: puremvc on November 18, 2009, 11:16:31
You don't necessarily want to suppress the sending of notifications that occur before a given notification has made its rounds.

If you are having problems with this sort of thing, I would suggest
a) More time spent planning your notification traffic, and
b) Looking into the StateMachine utility, which allows you to define discrete application states, such that the key notifications are sent out on state change. Only certain ACTION notifications can trigger state change, and you can ensure that all of your work in the given state is complete before sending out those notes.

-=Cliff>