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

Pages: [1]
Print
Author Topic: Best strategy ?  (Read 3310 times)
lulumOriss
Jr. Member
**
Posts: 14


View Profile Email
« on: December 29, 2011, 07:51:07 »

Hi all,

Another question regarding PureMVC best practices:
My application contains several identical screens, each including a video player. Each player plays a different source.
I hesitate between one mediator by player responding to a particular notification which contains the source or a unique mediator, differents names, for all players and one notification which contains all sources. In this case, the notification contains the mediator's name to set the source of the right player.

I don't know if I'm clear.

Actually, my question is: what would you do in that particular case?

Thanks.

lulu.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: December 29, 2011, 09:03:58 »

Most of the time, you have only one instance of a given mediator and view component.

When you need multiplicity, you must give each mediator to have a unique name. When you have multiple instances of a Mediator registered, you usually pass a value in the type property of the Notification that the each Mediator instance looks at to determine if the note is for them or not.

Have a look at the HelloFlash demo; the HelloSprite and HelloSpriteMediator, and SpriteDataProxy.

http://trac.puremvc.org/Demo_AS3_Flash_HelloFlash

-=Cliff>
Logged
lulumOriss
Jr. Member
**
Posts: 14


View Profile Email
« Reply #2 on: December 30, 2011, 03:20:58 »

Ok. Thank you.

lulu.
Logged
Pages: [1]
Print