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 / Architecture / Multiple proxies: knowing when they've all returned data on: November 24, 2009, 04:22:44
Hi all, I'm looking for some advice.

I have multiple proxies which make requests for data in their onRegister method. The proxies are all initialised simultaneously in a StartupCommand as the application starts, and the returned data from across all proxies is required before the rest of the application can run (they load navigation, content, etc).

The way I'm planning on handling this was to have a mediator, lets call it ApplicationMediator, which listens for completion notifications from each individual proxy, setting a boolean 'completed' value, and sending an "all data loaded" notification when all the boolean values are true.

Does this sound a reasonable solution, or is there any other alternatives I should be considering?
2  PureMVC Manifold / Standard Version / Passing multiple values to a command on: January 23, 2009, 08:35:43
I have a command, FullScreenCommand, which requires two key elements in order to function; an event which has fired (I need to check it's type) and a reference to the application itself (so I can change the displayState of the stage).

I'm passing the event via the notification body, the reference to the application I'm obtaining within the command as follows;

:
var applicationMediator:ApplicationMediator = facade.retrieveMediator(ApplicationMediator.NAME) as ApplicationMediator;
var app:MyApp = applicationMediator.getViewComponent() as MyApp;

Does this fit with the PureMVC principles, or should I be passing both the event and app instance via the body of a custom notification?

Thanks :)
Pages: [1]