PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: jkFlex on April 27, 2009, 12:39:49



Title: Question regarding Mediator reusability
Post by: jkFlex on April 27, 2009, 12:39:49
Hi,

I am planning to use a mediator for two different components with different package structures. I have registered the mediators with unique names.
For performing an action in the component how would I get the corresponding component in getter.

Please let me know if any possibilities.

Thanks


Title: Re: Question regarding Mediator reusability
Post by: puremvc on May 02, 2009, 06:16:38
Two ways to handle this:

1) Make bothe components implement the same interface. Then have the getter return the Interface rather than the class.

2) Keep a flag in the Mediator that says what kind of component is being held. Have two getters, one for each component type and referenct the appropriate one based on the flag.

Personally I'd opt for #1, and I'd write 2 mediators before doing #2

-=Cliff>