This ends week one of my investigations into PureMVC. So far I’m impressed with the framework itself in it’s many versions and incarnations, but the documentation and tutorials for platforms other than Flex leave something to be desired. To all those folks that claim that Cairngorm is easier to learn than PureMVC, I can agree, but only because of this lack of good documentation.
So what should we Java/GWT developers do? Taking a cue from my colleague Noel Rappin, we should Read the Source, Luke. This code reading is a triangulation excercise worthy of Bill Clinton, involving API docs, source in other languages and source in other versions and platforms.
ActionScript Code
- All the best examples are in ActionScript. Most useful is this minimal example showing how to wire up key presses to a controller and simple model.
- A much more sophisticated, multipart tutorial. The underlying application features an integration with Jabber.
- A tutorial on how to build a Flash site with PureMVC.
Java Code
- The J2ME simple login example is based on the singleton/standard version.
- The puremvc2gwt project has the simple login example ported from the J2ME example above. GWT doesn’t have reflection, and this is a singleton/standard version project, so you have to mentally factor out some of the resulting artifacts.
Other Sources
- Best Practices doc from the PureMVC site. This is probably the most critical doc in the whole PureMVC docuverse. Best practices and idioms.
Since I’m looking to use PureMVC accross my firm in Flex, GWT, JavaScript, WinForms, Swing, etc., I’m going to have to come up with a reference app and some best practices. Lots of work, but ultimately worth it. I may borrow liberally from Cocoa. And of course I’ll share my learnings here. Stay tuned.
P.S. For those looking for the next OpenSocial update, I’ll have something next week.

Hi Dietrich,
I came across ur blog a week bck & found valuable info reg the TikeSwing Project , I have been devloping on swing for last 2-3 yrs and have tried architecting the app in diff ways .. I feel that HMVC design really helps in loose coupling between various parts of the apps …especialy for large ones.
I have been trying flex of late and found it very similar to swing .. and hence the problems of design are similar,but data binding in flex alleviates some of it ….i am looking forward to ur future posts on some real world app using pure mvc .
Regards,
Pavan
Hi Dietrich,
Thanks for your post. There is far more documentation for the original AS3 incarnation of PureMVC than any other port, this is true. Specific tutorials and docs for other platforms is an area of the project where we could use contribution.
I have tried to write the primary documentation from a perspective that minimizes the importance of the language/platform and focuses on the roles, responsibilities and collaborations of the framework actors.
I know that this isn’t as good as having a specific Best Practices doc for Python, but I do know that it can still be effective to a Python developer.
In writing these documents, I took a queue from the Gang of Four Design Patterns book. It is replete with SmallTalk 80 examples, which I do not understand, but I can still grok the pattern well enough to implement it in my own language. In fact, that the actors are built on these design patterns is what allows it to be abstract enough to port.
Just as the Best Practices doc has been translated to german, french and chinese, it’d be nice to see someone offer to translate it to Java, Python and PHP…
-=Cliff>