PureMVC
PureMVC is a lightweight framework for creating applications in ActionScript 3, based upon the classic Model-View-Controller (MVC) design meta-pattern.
This open source framework is suitable for architecting applications on any platform running AS3. Currently, target platforms include Adobe Flex, Flash and AIR. Other AS3 platforms in the works include Mozilla foundation's Tamarin (JIT).
Implementation
In this implementation of MVC, the Model, View and Controller application tiers are represented by three Singletons (a class where only one instance May Be created). A fourth Singleton, the Façade, provides a single interface for communications throughout the application.
The Model, View and Controller Singletons maintain named caches of Proxies, Mediators and Commands, respectively.
- Data objects, be they local or remote, are managed by Proxies.
- The View Components that make up the User Interface are managed by Mediators.
- Commands may interact with Proxies, Mediators, as well as trigger or execute other Commands.
All actors discover and communicate with each other via the Façade, rather than work directly with Model, View and Controller.
PureMVC also introduces a Publish/subscribe-style Observer notification scheme. This allows asynchronous, event-driven communications between the actors of the system, and also promotes a loose coupling between those actors, since the subscriber never needs to have direct knowledge of the publisher.
uk:PureMVC