Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
April 28, 2017, 05:11:56 AM
Home Help Search Login Register
News: ATTENTION: Spambots must die! Humans must visit http://contact.futurescale.com to request forum access.
Pages: [1]
Print
Author Topic: Controllers as Mediators?  (Read 3193 times)
eco_bach
Courseware Beta
Sr. Member
***
Posts: 81


View Profile
« on: December 30, 2010, 02:15:22 PM »

Hi
Doing a lot of coding in Objective C lately, where mvc is really 'mvC', most of your application logic resides in viewControllers and this Controller functions primarily as a mediator between your model and view component.

I was wondering if and when it would make sense to apply the same logic to a PureMVC as3 project. ie instead of using a traditional PureMVC mediator, map a Controller command to a notification in your facade, and dump a lot of your view specific logic into this command.

Could anyone suggest or supply an example of architecting your application this way?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2865



View Profile WWW
« Reply #1 on: January 03, 2011, 09:19:38 AM »

It makes sense when there is a lot of logic involved. Creating or populating view components dynamically from multiple data sources where some computation is involved, for instance.

But for doing things like answering the view component's request for data by fetching it from the proxy and setting it on the component, the mediator is your best bet.

You don't want to spread the knowledge of the view components over many classes (i.e. having 5 Command classes that respond to simple requests from the component as opposed to 5 listeners in the mediator). Why? If you swap that component out, radically or change its exposed API, the refactoring impact is reduced to that single class if the mediator is acting as the single touchpoint in the app for the  component.

-=Cliff>
Logged
Pages: [1]
Print
Jump to: