PureMVC Architects Lounge

PureMVC Manifold => MultiCore Version => Topic started by: ankurpshah on December 09, 2010, 01:02:13



Title: Some thoughts about puremvc and view cluttering
Post by: ankurpshah on December 09, 2010, 01:02:13
Hi Cliff,

           Currently we are using command to register mediators, which typically requires view as notification body. But generally passing view as notification body is not preferable (correct me if I am wrong). So is it okay to pass view as notification body in case of any mediator registration (for e.g. startupcommand) ? or any other better by which we can separate out puremvc from view so view can be reusable without depending on any specific framework.

Thanks,

Ankur Shah


Title: Re: Some thoughts about puremvc and view cluttering
Post by: puremvc on December 10, 2010, 08:42:56
The beauty of the untyped body is you can send anything you want in it. Since Commands and Mediators must communicate for various tasks, sending view components in the note body is a necessity if we wish to do so in a decoupled fashion. That is, we don't want the Command or the Mediator to know each other directly, but to collaborate through notifications in a publish/subscribe fashion.

And their mutual collaboration with regard to view components isn't limited to Commands being used to register mediators. Commands can be used as component factories. Mediators can be used as component registries or caches. (i.e. the components they tend need not be attached to the view hierarchy).

-=Cliff>