I havent used pureMVC but worked with Cairngorm and havent felt too good with it. The problem I face with Cairngorm is that there is need to use observers to detect the change in the model. I mean the the view really has no idea when the model it consumes would change.
The problem here is when multiple UI components are trying to detect a change to the model, you have no idea about the order in which the views react. So cairngirm became a sure shot way of getting into trouble for me.
So I had to find other approaches. And a different approach find did I. :-) . Here is a brief description of my little MVC implementation.
- Create an interface that acts a contract between the view and the controller(handler)
Ex: -- > mx:Application implements="com.simplemvc.IsampleInterface"
3.Create a reference to the handler in the view . The handler should also hold a refernce to tghe view. Have something like
Ex:--> handler:SampleHandler id="myHandler" view="{this}" myData="{this.gridData}"
4. Call the methods in handlers/controllers when you need to .
Ex: handler.getData();
5.Have the handler call your remote Object/web service/httpservice and call back the view using the reference
Ex:view.updateCollection(data:ArrayCollection)
Checkout the source code here
Comments welcome.