Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


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

Pages: [1]
Print
Author Topic: Use case shift key state and mediators  (Read 3587 times)
coulix
Full Member
***
Posts: 23


View Profile Email
« 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 ?  ???
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
coulix
Full Member
***
Posts: 23


View Profile Email
« Reply #2 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
Logged
Pages: [1]
Print