PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: immerzeel on October 24, 2007, 02:05:54



Title: RemoteProxy / Mediator without view / runtime creation Mediator
Post by: immerzeel on October 24, 2007, 02:05:54
Hi,

I have some architectural questions for my Flash application.

Should put one query per RemoteProxy?
Because I cannot find a way to to add a token to my Remoting Call, so I can make a switch in the onResult/onFault handler.
Should I got for a multiple custom onResult/onFault or is there another way to distinct the calls in my non-Flex app?

Mediator without viewComponent
I have an ApplicationMediator that handles the visibility of the screens and a BrowserMediator, without a viewComponent, implementing SWFAddress (linking/urls for flashpages) in the navigation. http://forums.puremvc.org/index.php?topic=75.msg270#msg270 (http://forums.puremvc.org/index.php?topic=75.msg270#msg270)
In short, is it supposed to be a mediator or a command?

Two mediators depending on one RemoteProxy call
I have a remoting call that will update a Mediator/View and create multiple other Mediator/View pair and update their content.
What is the best way?
I saw the HelloWorld application do a creation on the view and add the mediator.
That was a great help, but how do I get the specific data to the right mediator/view pair?
Or should it be a command? And if so can I manipulate the mediators directly via a retrieveMediator?

Please advise on best practice solutions.

I would love to see more non-Flex examples of a real application, the flash HelloWorld was not really a RIA. I am a monkey-see-monkey-do learner :-).

thanks,

Pascal



Title: Re: RemoteProxy / Mediator without view / runtime creation Mediator
Post by: Dal on July 02, 2008, 09:53:56
Sup Bro,
I have done a couple of these things in an application that I am building, I do not know if it is best practice or not I am still going through that in another post but,

Mediator without viewComponent
For my swfAddress, I gave the stage root as a view for that mediator - I created that in a startup command - the name that I gave it is a constant.
I keep my constants in a separate file and just import them in as needed, so anything in the menu that needs to know the name of the mediator can just get it via my constants file. If I need to change pages, call new information or whatever within my RIA I just make it go through the swfAddress mediator and thus the browser buttons are all good.

Two mediators depending on one RemoteProxy call
In terms of dynamic mediators, I basically read in an xml list - within this list, I look within the tags for say id="item_group gallery".
This I know is a gallery so I instigate a gallery mediator which triggers several things.
I use a macro command to trigger several simple commands, to the macro command I give an object which has the page name, base mediator name and a section of xml.
The most important thing here is that the thumbs are all created dynamically, I give the page name _ base mediator name _ image name as the uniq mediator name.

When each of these thumbs are created their names are stored in an array, the array is stored in the base mediator and can be retrieved via a custom return function in the base mediator.
The last simple command in the macro command list can retrieve the base mediator as an object and then call that function of the object - I then have a list of all the uniq thumb names which I can run through in a for loop and send notifications to.

Hope helps......
Sounds like you were kinda on this way though, I'm still unsure if this is best practice though - Cliff??

Chur
~D


Title: Re: RemoteProxy / Mediator without view / runtime creation Mediator
Post by: puremvc on July 08, 2008, 10:26:15
This actually sounds like it might be a nice Command/Mediator collaboration.

-=Cliff>