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 / Re: viewstack, deferred mediator creation on: March 18, 2008, 02:35:18
thanks so much for taking the time to answer, i really appreciate.

ok, i think you re right, i didn't explain it well enough in my 1st post.
situation is quite simple: 1 viewstack, 1 viewstackMediator, 2 views, 2 viewMediators. 1 of the views with a control saying: "show the other view, and pass this data (a VO)".

flow is: view1 -> event -> view1Mediator -> notification with VO (no reference to the new component) -> command (viewStackMediator: change view, view2Mediator/view2: display VO data). Only that view2 is created when the viewStack changes, and its mediator after its "creationComplete", which means that it does not exist at the time of the command.
So i need at some point to stop the flow, store the VO and wait for the view2Mediator to be created.

i can find many workarounds to this, but i was wondering what was the best way to handle it.
thanks again.
2  Announcements and General Discussion / Architecture / Re: viewstack, deferred mediator creation on: March 18, 2008, 10:38:50
sorry, maybe i just don't get it.
doesn't that mean that the 1st mediator has to check whether the new mediator is already registered before sending its notification with the VO?

it's like: ok, the user pressed that button, i want to send that event with the corresponding VO, but wait, is the receiver already registered?

i m not a purist, just trying to get it the best way i can.
thanks for your help.
3  Announcements and General Discussion / Architecture / Re: viewstack, deferred mediator creation on: March 18, 2008, 01:21:06
thanks for the answer.
It makes sense, though i have 2 concerns:
- how is this going to scale up? if i have 10 views in my viewstack won't it be quite a mess?
- i m wondering if your solution really decouples the 2 mediators. It seems a bit odd that an "event dispatcher" has to know something about the receiver (listen for its onCreationComplete, then send the VO).
what do you think?
4  Announcements and General Discussion / Architecture / viewstack, deferred mediator creation on: March 17, 2008, 02:33:29
hi everybody!
sorry, another post about deferred creation... but i still haven't found what i m looking for.
i have a viewStack with deferred creation of views and mediators. The views send an event upon "creationComplete" to create their mediator. This works ok.
in one of the views i have a control to pass to another view so flow looks like: view -> mediator -> notification (carrying a VO) -> instantiation of the new view -> creation of its mediator. The problem is that this new mediator doesn't have access to the passed VO as it is not directly created by the notification but after the view is created. How would you deal with that?
Pages: [1]