PureMVC
Encyclopedia
PureMVC is a framework for creating applications based upon the well-established Model, View and Controller
design pattern
. The free, open source framework was originally implemented in the ActionScript 3 language for use with Adobe Flex
, Flash
and AIR, and it has since been ported
to nearly all the major web development platforms.
(a class of which only one instance may be created).
The MVC Singletons maintain named cache
s of Proxies
, Mediators
and Commands
, respectively. The Facade
, also a Singleton, provides a single interface for communications throughout the application. These four Singletons are referred to as the Core Actors.
All actors discover and communicate with each other via the Facade, 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.
The Standard Version Reference Implementation is written in ActionScript 3.
instead of Singletons. Rather than storing a single instance of the class, a Multiton stores a map of instances. Each Core is referenced by an associated Multiton Key.
The MultiCore Version of the framework was developed due to the widespread need for modular support in a world of ever-more ambitious Rich Internet Applications which must load and unload large pieces of functionality at runtime. For instance a PDA application might need to dynamically load and unload modules for managing task list, calendar, email, contacts, and files. The "multicore" version facilitates unit testing.
The MultiCore Version Reference Implementation is written in ActionScript 3.
-- implementations for various programming languages, each contributed and supported by PureMVC community members. Each port, in turn supports one or more target development platforms, which cover most major mobile, browser, desktop and server environments.
Model-view-controller
Model–view–controller is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates "domain logic" from the user interface , permitting independent development, testing and maintenance of each .Model View Controller...
design pattern
Design pattern
A design pattern in architecture and computer science is a formal way of documenting a solution to a design problem in a particular field of expertise. The idea was introduced by the architect Christopher Alexander in the field of architecture and has been adapted for various other disciplines,...
. The free, open source framework was originally implemented in the ActionScript 3 language for use with Adobe Flex
Adobe Flex
Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform...
, Flash
Adobe Flash
Adobe Flash is a multimedia platform used to add animation, video, and interactivity to web pages. Flash is frequently used for advertisements, games and flash animations for broadcast...
and AIR, and it has since been ported
Porting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...
to nearly all the major web development platforms.
Standard version
The Model, View and Controller application tiers are represented by three SingletonsSingleton pattern
In software engineering, the singleton pattern is a design pattern used to implement the mathematical concept of a singleton, by restricting the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system...
(a class of which only one instance may be created).
The MVC Singletons maintain named cache
Cache
In computer engineering, a cache is a component that transparently stores data so that future requests for that data can be served faster. The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere...
s of Proxies
Proxy pattern
In computer programming, the proxy pattern is a software design pattern.A proxy, in its most general form, is a class functioning as an interface to something else...
, Mediators
Mediator pattern
The mediator pattern, one of the 23 design patterns described in Design Patterns: Elements of Reusable Object-Oriented Software, provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's...
and Commands
Command pattern
In object-oriented programming, the command pattern is a design pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later time...
, respectively. The Facade
Façade pattern
The facade pattern is a software engineering design pattern commonly used with Object-oriented programming. The name is by analogy to an architectural facade....
, also a Singleton, provides a single interface for communications throughout the application. These four Singletons are referred to as the Core Actors.
- 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 Facade, rather than work directly with Model, View and Controller.
PureMVC also introduces a Publish/subscribe-style Observer
Observer pattern
The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods...
notification scheme. This allows asynchronous, event-driven communications between the actors of the system, and also promotes a loose coupling
Loose coupling
In computing and systems design a loosely coupled system is one where each of its components has, or makes use of, little or no knowledge of the definitions of other separate components. The notion was introduced into organizational studies by Karl Weick...
between those actors, since the subscriber never needs to have direct knowledge of the publisher.
The Standard Version Reference Implementation is written in ActionScript 3.
MultiCore version
This variation supports modular programming, allowing the use of independent program modules each with their own independent PureMVC 'Core'. A Core is a set of the four main actors used in the Standard framework (Model, View, Controller and Facade). This version of the framework uses MultitonsMultiton pattern
In software engineering, the multiton pattern is a design pattern similar to the singleton, which allows only one instance of a class to be created. The multiton pattern expands on the singleton concept to manage a map of named instances as key-value pairs....
instead of Singletons. Rather than storing a single instance of the class, a Multiton stores a map of instances. Each Core is referenced by an associated Multiton Key.
The MultiCore Version of the framework was developed due to the widespread need for modular support in a world of ever-more ambitious Rich Internet Applications which must load and unload large pieces of functionality at runtime. For instance a PDA application might need to dynamically load and unload modules for managing task list, calendar, email, contacts, and files. The "multicore" version facilitates unit testing.
The MultiCore Version Reference Implementation is written in ActionScript 3.
Ports
There are several active PureMVC portsPorting
In computer science, porting is the process of adapting software so that an executable program can be created for a computing environment that is different from the one for which it was originally designed...
-- implementations for various programming languages, each contributed and supported by PureMVC community members. Each port, in turn supports one or more target development platforms, which cover most major mobile, browser, desktop and server environments.
Language | Targets | Standard version | MultiCore version |
---|---|---|---|
ActionScript ActionScript ActionScript is an object-oriented language originally developed by Macromedia Inc. . It is a dialect of ECMAScript , and is used primarily for the development of websites and software targeting the Adobe Flash Player platform, used on Web pages in the form of... 2 |
Flex 1.5, Flash 8, FlashLite | http://trac.puremvc.org/PureMVC_AS2 | |
ActionScript 3 | Flex 2, 3, Flash 9/CS3, AIR. | http://trac.puremvc.org/PureMVC_AS3 - Original reference implementation | http://trac.puremvc.org/PureMVC_AS3_MultiCore |
C# | .NET 1.0/2.0 Silverlight, Windows Mobile and Pocket PC. | http://trac.puremvc.org/PureMVC_CSharp | http://code.google.com/p/libpuremvc/ .NET 4.0 using Concurrent Collection. Support single core in multi core. |
ColdFusion ColdFusion In computing, ColdFusion is the name of a commercial rapid application development platform invented by Jeremy and JJ Allaire in 1995. ColdFusion was originally designed to make it easier to connect simple HTML pages to a database, by version 2 it had... |
ColdFusion 8 | http://trac.puremvc.org/PureMVC_CF | |
haXe HaXe haXe is a versatile open-source high-level multiplatform programming language described on its website as a "universal language".It can produce:* Flash applications and games* Multi-platform client-side web applications* Apache CGI web applications... |
JavaScript, Flash 8, Flash 9 and the Neko VM. | http://trac.puremvc.org/PureMVC_Haxe | http://trac.puremvc.org/PureMVC_Haxe_MultiCore |
Java Java (programming language) Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities... |
Java Mobile, Standard and Enterprise Editions (ME, SE, EE), JavaFX, Servlets, Applets, and GWT | http://trac.puremvc.org/PureMVC_Java | http://trac.puremvc.org/PureMVC_Java_MultiCore |
JavaScript JavaScript JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles.... |
Browser neutral | http://trac.puremvc.org/PureMVC_JS | |
Objective-C Objective-C Objective-C is a reflective, object-oriented programming language that adds Smalltalk-style messaging to the C programming language.Today, it is used primarily on Apple's Mac OS X and iOS: two environments derived from the OpenStep standard, though not compliant with it... |
Apple iPhone and Mac | http://trac.puremvc.org/PureMVC_ObjectiveC | |
Perl Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular... |
Perl 5 | http://trac.puremvc.org/PureMVC_Perl | |
PHP PHP PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document... |
PHP 5 | http://trac.puremvc.org/PureMVC_PHP | |
Python Python (programming language) Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive... |
Python 2.5 for wxPython, Google App Engine, Pyjamas http://pyjs.org/examples/employeeadmin/PureMVC_Python_1_1/ | http://trac.puremvc.org/PureMVC_Python | |
Ruby Ruby (programming language) Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto... |
http://trac.puremvc.org/PureMVC_Ruby/ | ||
C++ C++ C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell... |
Thread-safe. Compile with: MSVC 8.0/9.0/10.0, MinGW 3.4.5, GNU G++ 4.0, Embarcadero C++ 6.21 (MFC, WTL, wxWidgets, Qt...) | Support single core in multi core http://code.google.com/p/libpuremvc/ | http://code.google.com/p/libpuremvc/ |
External links
- Official website
- PureMVC Training at Rich Media Institute
- Intro To PureMVC on Adobe Edge
- Understanding the PureMVC Open Source Framework on ActiveTuts+
- PureMVC Console from Kap Labs
- The Algorithmist on PureMVC
- WebORB Integration Server (WebORB for .NET, WebORB for Java, WebORB for PHP) includes PureMVC code generation
- PureMVC JavaME class diagram