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: Some thoughts about puremvc and view cluttering  (Read 7741 times)
ankurpshah
Newbie
*
Posts: 3



View Profile Email
« 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
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 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>
Logged
Pages: [1]
Print