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: Multiple instances of the same mediator/proxy? on: October 17, 2008, 06:14:53
Thanks for the reply. I got the idea of unique id + NAME. What about the notification then? To my understanding, the current notification mechanism of puremvc is at "class" level, instead of instance level. Any good idea to make it work at instance level?
2  Announcements and General Discussion / Architecture / Multiple instances of the same mediator/proxy? on: October 17, 2008, 01:42:38
Greetings, everyone!

I just finished reading through the docs (hopefully I understood most of them) and started to really use puremvc in my app. There is a situation that the same view component will have multiple instances at the same time and thus multiple instances of the same mediator/proxy. To give you an concrete example, I have a Business explorer, where you can search for businesses and result will be displayed as a list; when user selects a business in the list, a new tab will opened to display the details of this business. So you could end up with multiple tabs open at the same time to display multiple business details. I will have the following classes:

BusinessView - view component that displays business detail
BusinessViewMediator - mediator for BusinessView
BusinessDetailProxy - proxy that loads/updates business detail

Here are the questions I can think of for now:
  • How should I name each of the instances when registering them?
  • When instantiating these instances, I am thinking to use a command that will create an instance of the mediator and then create the corresponding instance of the proxy, is this the right way to instantiate them?
  • To keep the link between corresponding mediator and proxy, do I need to store reference to each other in them?
  • When BusinessDetailProxy sends a notification, how do I make sure that only the corresponding BusinessViewMediator instance act upon it?

Thanks in advance.
Pages: [1]