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: Mediators directly communicate with Proxies?  (Read 3984 times)
masterkrang
Newbie
*
Posts: 7


View Profile Email
« on: November 30, 2010, 12:34:01 »

I'm am totally new to PureMVC. Thanks for having me here. So far I noticed PureMVC solving a lot of questions I had when starting to develop larger flash projects, most notable managing multiple view / component events, how to keep track of them and how to make sure others knew about them.... can be a nightmare.

I've been using the project example CafeTownsend (found on this site) as a guide while writing my own sample app (a Flash Builder app that connects to twitter api). One thing that stood out to me after trying to write this sample application was the role that the Controller or Commands play. They seem to have a really passive role from what I see in other MVC frameworks like Ruby. I'm not totally versed in MVC frameworks, and I'm sure there is an explanation, but I couldn't figure it out. I was surprised that the Mediators were connecting directly to the Proxies when they needed data, not involving the controller very much during that process. Is that a normal thing in MVC?

In my application now, I can use my Flex components (Views) along with Mediators just fine to get the data I need from the Proxies. The event model makes sense and it's pretty clear how things are less coupled than other approaches and more reusable. I'm just having a little bit of trouble figuring out what role the Commands play in this process. As of now, based on the Cafe Townsend project, the Commands simply instantiate the views on startup. I don't know why but it seems a little bit odd for me to think of a Command as a Controller. If anybody wouldn't mind shedding some light on the roles that Commands play, share insightful tutorials that would be great.

Thanks

Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #1 on: November 30, 2010, 02:38:12 »

In MVC definition it is said that the view can have full knowledge of Model. But the Model must not know directly the view. This said, Model can send update signals via an Observer pattern to any view listening for a specific update as it does not know its concrete classes.

In PureMVC for AS3 what you probably saw where view consuming VO coming from the model with an automatic update mechanism involved by the Flex Framework. This uses Observer pattern, the model doesn't know the view so it is always "pure MVC". ;)
Logged
masterkrang
Newbie
*
Posts: 7


View Profile Email
« Reply #2 on: November 30, 2010, 10:30:37 »

Thanks for the reply Tek.
Logged
Pages: [1]
Print