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

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / Re: Notification Stacking on: April 24, 2008, 11:07:23
I have the similar problem. I want mediators to recieve notifications in the order they were sent. I want to illustrate the issue with example of a turn-based game.
I have the GameProxy, which handles game's logic. Also there are StartRoundCommand and StartTurnCommand, registered with START_ROUND and START_TURN notifications accordingly. And there are also mediators, listening for these notifications.
When the game starts, I send START_ROUND notification, which executes StartRoundCommand, which calls startRound() method in GameProxy. In this method I sent START_TURN notification, which executes StartTurnCommand. So, mediators first recieve START_TURN notification and then START_ROUND notification. This is not what I'm expecting for. So, I have to delay GameProxy's method startRound() to achieve the correct order of notifications to be recieved by mediators. But this is very very ugly solution and I want to refactor it as soon as possible.
What will be the best solution of this problem?
Pages: [1]