Mediator acting as Controller

peng's Avatar


05 Nov, 2009 05:07 PM

I noticed in the examples that the Mediators often respond to an user event by directly operating on a Model (calling a public method). This blurs the distinction of the Mediator acting as a ViewController and a ModelController. Wouldn't it be more appropriate in the stricter MVC sense, to map a Command which will update the Model instead? That is a practice I try to adhere to when using PureMVC.

  1. Support Staff 1 Posted by Joel Hooks on 05 Nov, 2009 05:10 PM

    Joel Hooks's Avatar

    Here is Cliff Hall's take on it as it relates to PureMVC.

  2. 2 Posted by simon on 05 Nov, 2009 05:25 PM

    simon's Avatar

    In the past I was quite regimental on the whole Mediator/Proxy communication but over time and a load of projects I soon realised that simple hand grabs into a Proxy are in my opinion absolutely fine.

    A framework for me amongst many other things was to try and make my code simpler and reduce the amount to a degree, also I wanted to mould it to what worked best for me. Triggering a method, or simply grabbing a bit of data from a public getter in a Proxy seemed a minor triviality in comparison to doing the same task by firing off a notification, the facade triggering the Command, then Command then talking to the Model and so on.

  3. Joel Hooks closed this discussion on 08 Nov, 2009 09:01 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac