PureMVC Architects Lounge

PureMVC Manifold => Standard Version => Topic started by: lulumOriss on December 29, 2011, 07:51:07



Title: Best strategy ?
Post by: lulumOriss 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.


Title: Re: Best strategy ?
Post by: puremvc 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>


Title: Re: Best strategy ?
Post by: lulumOriss on December 30, 2011, 03:20:58
Ok. Thank you.

lulu.