PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: coulix on November 09, 2009, 03:05:28



Title: Use case shift key state and mediators
Post by: coulix on November 09, 2009, 03:05:28
Hello Pure Flexers,

I wanted to share a small design question i am on.
I have several mediators who need to know the state of shift key (stage) at a given time.

For now each mediator was listening for key down event and updating a local boolean isShiftKeyActive.
Each mediator also have their own proxy.
I was thinking of adding a sharedProxy unique for all mediators which will have other properties and actions than a shift key state holder.

What do you think ?  ???


Title: Re: Use case shift key state and mediators
Post by: puremvc on November 10, 2009, 07:33:08
Instead of having each mediator listening for the event, (and thus having a reference to the same view component (the application), you should have an ApplicationMediator that listens and rebroadcasts to the other mediators as a notification.

-=Cliff>


Title: Re: Use case shift key state and mediators
Post by: coulix on November 10, 2009, 10:22:11
Ok and they still keep their local boolean.
I created a keyBoardProxy to hold the variable in the mean time but using notifications fired from application Mediator is cleaner.

Greg