PureMVC – A Multiplatform Framework
As of late I started to do some research and make a list of the most popular open-source frameworks used in Flash/Flex/AIR development. But, unlike my previous posts, today I’m writing about a far more general framework: PureMVC.
The framework has two versions that are supported with reference implementations Standard and MultiCore. “In short, the Standard Version provides a simple methodology for separating your coding interests according to the MVC concept. Beyond that, the MultiCore Version allows multiple PureMVC applications to run within the same virtual machine, modular programming.”
PureMVC implements a different concept in contrast with the standard MVC design pattern. The Model, View and Controller are implemented as Singleton classes:
- The Model caches named references to Proxies, which expose an API for manipulating the Data Model (including data retrieved from remote services).
- The View primarily caches named references to Mediators, which adapt and steward the View Components that make up the user interface.
- The Controller maintains named mappings to Command classes, which are stateless, and only created when needed.
There is a fourth class, the Façade, that initializes and caches the Core actors (Model, View and Controller), and provides a single place to access all of their public methods. It acts as a communication bridge throughout the application. These classes are referred to as the Core Actors.
The framework has a Publish/subscribe-style Observer notification system and the communication is being done through this scheme rather than AS3 Events, which is understandable considering the whole group of languages that’s covering.
The differences between the Standard and MultiCore version, like the name underlines it is that the second one uses independent program modules each with their own independent PureMVC ‘Core’. And instead of Singleton classes there are Multitons(stores a map of instances). Each Core is referenced by an associated Multiton Key.
This project has a well developed documentation containing: source code freely available, complete API documentation, conceptual and UML Diagrams and plenty of demos show the basics and demonstrate best practices.
Because the amount of information about PureMVC is vast I tried to be as succinct as possible. Like most of the MVC frameworks, pureMVC has some good points and some bad ones. But the fact that it’s trying to be general and reach different platforms can be an issue. I am just saying that the generalization of this framework can make it mediocre in some way.
For a deep insight of this framework and its documentation check the PureMVC site.