Got it.
Now, I need to know if I'm misusing the mediators.
Beyond that they have no need to be aware of each other. This is why mediators take the role of feeding the components their data, and listening to their events, and notifying the rest of the system on their behalf.
Do you recommend doing things like setting dataproviders on grids directly - or - be as rigid as giving the view component an interface that the mediator uses to communicate with the view, or something in between?
I ask because of this:
In Cairngorm, the best practices is to bind the Model directly to the view (which I think is horrible anyway) and that goes against any MVC architecture IMO. So, lets say I have a button who's enabled property needs to be driven by a field in the model, which is driven by whatever circumstances it needs.
So, in cairncrap, we would say something like <mx:Button id="btnMyButton" text="My Button" enabled="{Model.getInstance().buttonEnabledProp}"/>
In pure mvc, the mediator would receive a notification, check the value on the model, and either set the enabled property by saying myButton.enabled = true/false or do some sort of communication through an API (aka interface aka setter).
It seems to me that since the logic of the button's enabled property is driven by the mediator, that the component becomes useless without it's mediator master, and therefore can't be re-used without some re-factoring.
So, with this example (and with some of the pureMVC examples), it seems that it would be better to use an interface to enforce the correct behavior of the mediator/view interaction. No?
Additionally, this leads me to my original question. Since it is easy to fall into the trap of the view becoming slave to the mediator, with a composite component that is made up of a lot of sub-components, and their sub-components, and etc, how do we manage this and all of the notifications in the pure mvc manner?
Is there a better way to handle constants? I know the app facade is a convenient place to put them, but is there another best practice way?
Thanks Cliff.