puremvc
|
 |
« Reply #1 on: October 18, 2007, 01:18:30 » |
|
William,
Your first interpretation of the statement was correct.
Generally, we want the edits made at the DataGrid (or any visual control) to automatically update the Model, and in turn have other parts of the View informed of such changes if necessary.
If this is not the case, then sure, clone the data (an interesting job depending upon how complex it is) and use a different ArrayCollection (or Array for that matter). Then capture the events that happen at the View and shuttle them back to a Proxy method via the Mediator and/or a Command. Then send Notifications that will be heard by all the interested Mediators so that their view components will be updated.
The reason for simply retrieving the reference from the Proxy and setting it as the dataProvider for the visual control can just be filed under 'playing well with other frameworks'.
That is to say, Flex provides a wonderful solution for updating the data and dependent visual controls when changes happen. The ArrayCollection and XMLListCollections simply do the right thing.
If you happen to be using PureMVC with Flex, it'd be silly to repeat all that effort by adding methods and Notifications in the Proxy that duplicate what Collections are providing. Especially when those classes are going to be compiled into your app anyway if you just use them to hold data.
-=Cliff>
|