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 / Getting Started / Re: Best practices on proxy/mediator relationShip on: September 29, 2010, 01:06:32
Thank you for your response.

I 'll try to explain a little more my second question.
For example with the following structure :
componentA/mediatorA/proxyA
componentB/mediatorB/proxyB with B include in A
mediator A need to listen to mediator B notification

And now i use multi instances of A and B in my application. I understand the use of a unique id to be pass in the notification and this what i have done in my application. 
But you need  to share you id with 'child' mediator so that  A handle only its 'B' notifications.
So you have an id that is passed in all notifications (concerning those components)

In fact it is not really a question. I understand the way it should be implement. I just wonder if it is no going to increase complexity with a large component hierarchiy

Cyril


2  Announcements and General Discussion / Getting Started / Best practices on proxy/mediator relationShip on: September 27, 2010, 03:36:18
Hello,

After a first PureMVC project implementation i found some points where i'm not pretty sure :

- Reference of the proxy in the mediator

I try for all the project to avoid that kind of link to prefer using the following chain
mediator notification/command/proxy/delegate/proxy notification....
But I got a single command that only retrieve  proxy to call a method of it API
A lot of code when i can do it directly in the mediator.
Is there a kind of consencus for when we can use the proxy directly in the mediator or not.

- Multi instance of proxy and mediator ?

This is what i m' the most confuse with puremvc. When i have multi instance of mxml component in my application. For example a list of user that can appear in several view. So i have an instance of mediator for each view. But the list of user can be different (for exemple a list of authorized users and a list of banned users). So I imagine that I also have to manage 2 proxy and the mediator will only be interresting in there proxy notification. I understand that mediator can send notification that use type argument as discrimination.

But  some time the mediators are register in other mediator so the discriminator need to be passed through several mediator. And for a simple view it is ok but I wonder if it is not too laborious to passe the type from mediator to command to proxy (with asynchronous request) and then back to mediator in big application.
Is there another way to do it ?

Thank you for any help or suggestion

Cyril Balit
3  Announcements and General Discussion / Getting Started / Multi instances of proxy and mediator on: December 30, 2009, 11:54:06
Hello,

I try using puremvc on a real backoffice application and some questions of "best practice" appears during implementation.

1. does the proxy have to hold only one data ?
I made a UsersProxy that hold the list of user of the application but i also have to keep the current logged user. Do i have to make another seperate proxy or can i add another property and method to my users proxy ?

2. Multi instance of proxy and mediator ?
This is what i m' the most confuse with puremvc. When i have multi instance of mxml component in my application. For example a list of user that can appear in several view.
All the mediator that send notification can use type argument as discrimination.
1.Then i can use one instance of userProxy that save the type, use delegate to retrieve data and send back notification passing the saving type.
2.Or use multi instance of proxy create or retrieve in the command using the type as name.

And some time the mediators are register in other mediator so the discriminator need to be passed through several mediator.
I wonder if it is not too laborious to passe the type from mediator to command to proxy (with asynchronous request) and then back to mediator in big application.

So a lot of question but as i really enjoy the global architecture of puremvc i would like to build application in the most "academic" way.

Thank you for any help or suggestion

Cyril Balit



Pages: [1]