The framework that swallowed the Gang of Four book.
PureMVC is an MVC framework where you dont get to work with the Model-View-Controller part of it at all. The MVC part of the framework are Singletons that are accessed by Proxies, Mediators and Commands. There is a fourth Singleton, a Facade, which enables the Proxies, Mediators and Commands to communicate with each other in a meaningful way.
- Model - accessed by named proxies
- View - accessed by named mediators
- Controller - accessed by named command objects
The Facade exposes methods to add, remove and get; proxies by name, mediators by name and commands by name. It also has a method to send a notification (another pattern). The framework intends that the developers do not interact with the MVC structure directly, instead using names and the central Facade to interact with the MVC structure via the secondary patterns of proxy, mediator and command.
The mediator interacts with the View's data via notifications. A mediator can be interested in multiple notifications. The proxy follows the same mechanism, it interacts with the Model via notifications. The controller contains mappings between commands and notifications. A command may retrieve and interact with a proxy, notify a mediator, or execute another command object. As per the GoF command pattern there is a SimpleCommand and MacroCommand where the latter's execute method can implement the execute interface on an aggregate of SimpleCommand's execute method.
Notifications are done through the Observer pattern. The observer carries a reference to the object that wants to be notified and the method that the notification will be broadcast too. It is up to the View to manage the mapping of notification names to observers when a notification is sent.
So what are the pros and cons of using this? The pros is that it is well defined as per the GoF book which has become the franca de lingua for software developers. The downside of the Gang Of Four book usage is that it causes abstraction proliferation where in many instances a simple procedural or concrete object that cracks a developers ribs is simpler, easier, less fragile and less confusing. Another downside is that pureMVC code is not portable unless you use pureMVC again. From experience, I have already seen that a classically OOP designed system bears no relevance in a pureMVC system, essentially removing any portability for that code to other systems. This system also suggests that it is over-designed as the actual MVC structure is abstracted away from the developer into proxies, mediators and command objects. Then again, this level of design and abstraction may prove more maintainable in the long run. We shall certainly find out.
Note It reminds me more of a CORBA system than an MVC one. I worked on a large CORBA system several years ago. It was solving the issue of multiple desktops running the same application. Apache and HTTP made that whole set up redundant. I recall a website was placed over the top of the CORBA system since so much work had gone into the underlying structure. Not sure that pureMVC's level of abstraction is solving a known problem domain, as I have worked with smaller MVC frameworks that did not run into blending of responsibility issues.
A quick discussion of the Observer and Notification pattern in the pureMVC framework.
Model The model is interacted with through Proxies which can send notifications, but do not receive them. A command will operate on a proxy object directly through a method call, such as, demoProxy.changeThis(Obj), and the proxy, realizing that its state has changed, can then send out a notification for other mediators and commands to react to its new state.
View The View is interacted with by mediators which can have multiple notifications (think events) they are listening to. Mediators can send and receive notifications, as well as allow other parts of the system to ask what notifications they are interested in.
Controller Commands are mapped to notifications by the central Facade. The controller responds to notifications and, based on notification name, and the mapping, will fire the command and execute it. A command interacts with a proxy (model) directly through a method call. A command can also interact with a mediator (view) directly or through a notification. The direct manipulation of a mediator can make the controller and view tightly coupled, but is possible within the system.
Since we are using PureMVC we recently had a heated discussion over whether to name the value object with a VO on the end. A kind of Flex form of Hungarian notation. One of the issues is names clashes, despite having different package names dividing up the namespaces so that each object name is different the IDE usually just displays them in the dot completion drop down as just the object name. Which can cause confusion.
I would prefer not to have to name everything with some form of end descriptor such as Command, Mediator, or Proxy but PureMVC breaks the functionality up so much that the naming ends up becoming repetitive. Also, because of the heavy use of patterns the object names tend to be meaningless unless the command, mediator or proxy is added onto the object name.
For instance a Command object is one with an execute() method that is requester agnostic and the object asking for that operation being performed doesn't know or care what the command object is doing, or going to do.
Value objects are slightly different. In the PureMVC system they are the closest thing we have to classical OOP objects. They describe a 'something' with private variables and getter and setters. So if any component in the PureMVC system should be named with a hard descriptor, it is the value objects.
A counter argument is that adding VO to the end of an object name aids readability. I consider most of this kind of readability as code litter. The reason we don't use Hungarian anymore is that it was a big mess. The convention of underscoring private variables is unnecessary in languages that have the private modifier to variables and functions. Underscoring their variables names is meaningless. So it is with package namespaces and object names.
The best argument for making the value objects carry the VO is that the IDEs tend to lump everything together in the dot completion drop downs. In my opinion this isn't a good enough argument to demand the addition of the VO identifier.
Software teams tend to be democratic to an extent and in this issue the team is slightly split. Programmers tend to treat their writing of code with care and make sure the formatting is all clean, evenly spaced and to their aesthetic liking. So something as simple as adding VO to an object descriptor can evoke some heated discussion and heels being dug in. Such is the fun of software development in teams.
Most Popular on South Sea Republic
The articles that have been viewed the most:
Most Popular Restaurants in Phoenix
Phoenix Eats Out is the restaurant review site for
Phoenix,
Scottsdale and
Old Town Scottsdale which lists the modernist and contemporary restaurants, taverns and bars in the greater Phoenix area.
This is the list of the most popular restaurants pages from phoenixeatsout.com that have been viewed the most;
My personal favourite restaurants in Phoenix are
AZ88,
Postinos,
Bomberos with
Grazie,
Humble Pie,
Orange Table,
The Vig,
Fez and others coming close behind. View the complete list with the photo-journalistic style images on
phoenixeatsout.com
Most Popular Hikes in Arizona
Arizona is an outdoor state and has lots of hiking in the city and around the state. Phoenix is unusual for most cities in having several large mountains in the center of the city with great hiking. Anyone who comes to Phoenix has to do the
Echo Canyon trail on Camelback and the
Summit Hike on Squaw Peak or Piesta Peak. The views of the city, suburbs and surrounding mountains are wonderful from Camelback and Piesta Peak.
For more experienced hikers there is the McDowell Mountains in North Scottsdale that has several difficult and strenuous hikes in
Tom's Thumb and
Bell Pass. Alternatively, you can hike the highest mountain in Arizona. At 12,600 feet
Humphrey's Peak is a long and difficult hike.
Alternate Australian Constitutions
Between 2004 and 2009 this site,
southsearepublic.org, was a constitutional blog based on scoop which focused on Australian and global constitutional issues.
One of the strongest aspects of it was the development of constitutions by those involved in the blog. These constitutions are the outcome:
The constitutions were built using principles from Montesquieu's separation of powers, the enlightnment's universal political rights and the ancient Athenian technology of sortition and choice by lot.
Archives For South Sea Republic
South Sea Republic started in 2004 as an Australian constitutional blog in 2004 based on scoop software. It was an immigrative outgrowth of Kuro5hin. The archives for each year since then;
The articles are ordered by views.
Who Is Cam Riley

I am an Australian living in the United States as a permanent resident.
I am a software developer by trade and mostly work in Java and jump between middleware and front end.
I originally worked in the New York area of the United States in telecommunications before moving to Washington DC and
working in a mix of telecommunications, energy and ITS. I started my own software company before heading out to
Arizona and working with Shutterfly. Since then I have joined a startup in the Phoenix area and am thoroughly enjoying myself.
I do a lot of photography which I post on this website, but also on flickr. I have a photo-journalistic website which lists
the modernist and contemporary restaurants in phoenix. I have a site on the
Australian Flying Corps [AFC] which has been around since the 1990s and which I unfortunately
lost the .org URL to during a life event; however, it is under the
www.australianflyingcorps.com URL now.
The AFC website has gone through several iterations since the 90s and the two most recent are
Australian Flying Corps Archives(2004-2002) and
Australian Flying Corps Archives(2002-1999) which are good places to start.
Websites Worth Reading
Websites of friends, colleagues and of interest;