Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
April 27, 2017, 05:27:12 PM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.
Pages: [1]
Print
Author Topic: Best strategy ?  (Read 2415 times)
lulumOriss
Jr. Member
**
Posts: 14


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

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: 2865



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

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
« Reply #2 on: December 30, 2011, 03:20:58 AM »

Ok. Thank you.

lulu.
Logged
Pages: [1]
Print
Jump to: