MVC and Actionscript
I have to admit that I’ve tried to use the MVC pattern for coding projects in the past and have never committed fully to using it for all UI objects in the project. Sometimes MVC just seems like too much work for a simple button, for example. Maybe, I just don’t understand how to apply the pattern, but I’m pretty sure I understand the concept. To me, the MVC pattern still has points of tight coupling. For example, your View subscribes to Model events. The Controller holds onto references to the Model and the View.
I’ve just found PureMVC and am trying to understand their implementation. It seems like their architecture is based on really loose coupling. Objects subscribe to messages (not tied to an object at all), and other objects broadcast messages. Subscribers and Publishers don’t know about each other. It sounds like a good idea to me. I’ve seen examples out there of eventmanager objects (subscribers and publishers interact with the eventmanager via the subscribing and publishing of messages) and have used them in projects before and PureMVC sounds like it’s built around this flexible way for objects to communicate with each other. One down side could be that there may be too many message flying around the system. I’m still trying to get my head wrapped around this so let’s see how well this works. I’m following this tutorial.