topleft
topright

PureMVC on Google

PureMVC Blog-o-Sphere

Supporters

Linked-In Group

PureMVC on LinkedIn
 
Image
 
Where Should I Declare Notification Name Constants Print E-mail
Tuesday, 19 August 2008

QUESTION:

I want to know where one should declare notification name constants. Should they be declared in Proxies or in ApplicationFacade?
 
Also, declaring notification constants in my ApplicationFacade will really lengthen up the file. I was thinking of declaring them in a separate file called as ApplicationConstants but is there any other method of keeping the notification names?

ANSWER:

The concrete facade for your application (typically called ApplicationFacade) is just a handy place common to all the notification participants, and since it also uses constants for Command / Notification mappings, it is usually a reasonable place, if you don't have many constants defined.

But you have a lot of constants you can just as well put them into a separate file like ApplicationConstants. Keep it at the same level in your hierarchy as your ApplicationFacade. This is particularly useful if the constants are to be shared, as in a library.

 

The View tier and Controller tier work together to service the unique use cases of a single given application, but you don't want Mediators referring to constants defined on Commands or visa-versa, otherwise they'd be in the same tier. So a common, neutral place like the ApplicationFacade or an ApplicationConstants file allows the two to work together without forming dependencies on each other.

 

And since an application's unique View and Controller tiers are almost always meant to allow you to interact with a specific Model, is perfectly fine for both Commands and Mediators to be mapped to Notification constants defined in the Model tier (typically in Proxies or ModelConstants classes), and to retrieve and interact with the Proxies directly. 

 

However, the Model should be the most isolated tier, able to be moved in its entirety to another application (perhaps the AIR version of a Flex app) with completely different use cases and UI (View/Controller tiers).

 

Therefore, the Model tier (Proxies) should not reference anything specific to your Controller/View tiers or your ApplicationFacade/ApplicationConstants.

 

You should have the Model define its own constants for the Notifications it sends. This makes the Model tier portable. This is also why Proxies cant receive Notifications - you might be tempted to make them listen for Notifications that are defined elsewhere in the application, thus forming an undesirable Model dependency on the View/Controller tiers.
Delicious
Technorati
Reddit
Furl it!
NewsVine
YahooMyWeb
Stumble
blogmarks
Digg
co.mments
connotea
 

PureMVC on the Web

Recently, Omar Gonzales at Almer/Blank developed and released ZamfBrowser; a ZendAMF service browser.  The AIR application was built using PureMVC Standard. for ActionScript 3 and the source code has kindly been made available online at the project's dedicated website

 

• ZamfBrowser Source Code Repository | Docs and Download

Almer/Blank Labs

 

 
The guys over at Pyjamas (a Python port of GWT) have made their compiler so efficient that it can take virtually any Python library and it will compile to Javascript. They loved the look of PureMVC Python, and decided to do a couple of demos that use it.
 

Pyjamas Project

• EmployeeAdmin Demo: Original / Pyjamas  

Pyjamas PureMVC Timesheet Demo

 
Chandima Cumaranatunge, co-author of the O'Rielly book AS3 Design Patterns, and long-time PureMVC community member recently created a simple Flash/AS3 MultiCore demonstration application accompanied by an informative article that's an excellent introduction to the benefits of working with MultiCore.
 
Who Moved the Cheese? - Demo / Source / Article

ActionScript 3 Design Patterns

 
FlashDevelop has gained quite a bit of ground in the development community so naturally several folks have created templates to ease the burdon of creating implementation classes. We'll let you be the judge of which are the best.
 
FDT PureMVC Templates, Well Formed and Pimped - Aron Woost
PureMVC First Thoughts and FlashDevelop Templates - Dave Keen

FDT Templates for PureMVC/AS3 Available - Pedr Browne

 

Ahmed Nuaman has published a well conceived and received AS3/PureMVC tutorial at FlashTuts.com. It's a good place for the learner to get their feet wet, and goes into the difference between using PureMVC with Flex as opposed to Flash or pure AS3.

 

Understanding the PureMVC Open Source Framework

FlashTuts Website
Ahmed's Website

 

 

Recent Project Activity

The PureMVC Java MulitCore GWT EmployeeAdmin Demo has been updated, now using Google Web Toolkit 2.0.

 

View the Demo

GWT EmployeeAdmin Project

 

The AS3 Undo Utility adds the ability to undo/redo actions in your PureMVC based Flex, Flash or AIR applications. The latest version is ready for download, and be sure to check out the demo to see how to implement.

 

AS3 Undo Utility

Flex HistoryPanel Demo

 

The PureMVC AS3 StartupManager Utility and its associated demos have been significantly refactored and improved. And to dispel the notion that the utility is only useful at startup time, it has been renamed Loadup

 

Loadup Utility 2.0

Loadup as Ordered Demo

Loadup for Assets Demo

 

The PureMVC / Objective C 1.1  has been released to keep up with the iPhone 3.0 SDK ( where 'dot notation' no longer seems to work ). 

 

PureMVC Framework for Objective C

Objective C Unit Tests

Employee Admin Demo


 

The Java MultiCore release 1.0.6 is available along with matching unit tests, utility and demos!

 

MultiCore Port & Unit Tests

Pipes Utility & Unit Tests

AsyncCommand

Employee Admin GWT Demo

 

 
Copyright © 2006-2008 Futurescale, Inc.