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: data binding  (Read 8698 times)
pwhitfie
Courseware Beta
Newbie
***
Posts: 3


View Profile Email
« on: September 20, 2007, 09:27:33 »

Hi,

I'm wondering where (if?) flex data binding fits into the pureMVC model.

It seems to me that the intention is for Mediators/Proxies to handle the updating if models and view components when something changes or am I missing something?

Cheers,

Peter
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: September 21, 2007, 07:46:22 »

PureMVC was written to be a pure ActionScript implementation. MXML data binding is Flex-centric and therefore was considered verboten for framework functionality. When PureMVC is ported to Tamarin (or even to non-Actionscript OOP platforms like J2ME), if MXML data binding were core to the PureMVC implementation, we'd have to rethink the thing entirely.

But obviously, use of PureMVC should not keep you from using all that wonderful data-binding goodness that Flex gives us! Frameworks should play well together, thats the way synergy happens.

Although internally, a PureMVC application 'wires' itself up by way of communications between Commands, Mediators and Proxies, the View Components themselves frequently make heavy use of data-binding. For a good example, simply pop over to the Architecture 101 Demo here on the PureMVC.org site, click View the Source, and in the view.components folder, have a look at the UserForm.mxml class. Lots of data-binding going on there.

Data-binding is a wonderful tool for doing the 'internal wiring' of View Components. It really helps us to achieve a nice 'black-box' encapsulation of our implementation. Rather than having a Mediator set data down into the actual controls of a View Component, we have the component expose a property, which we then bind our controls to. So when the Mediator sets the property, the controls are updated automagically, and the Mediator didn't need to know very much at all about how the component was implemented.

-=Cliff>
Logged
Pages: [1]
Print