12-02-2010 02:18 PM
I'm Cliff Hall from the PureMVC project.
While there may be plenty of old hands at AS3 here, I suspect many of you may be coming to AIR and AS3 from other platforms and languages.
Maybe you're drawn by the lure of awesomeness that the Playbook radiates, but confused about how to write structured code in AS3. If you're a seasoned developer, you know that for anything beyond 'hello world', you really need to start applying some design patterns and paying attention to the roles, responsibilities and collaborations of your classes.
Or maybe you're used to writing large, messy AJAX / HTML apps and are looking to step up your game and make your life a lot easier with OOP.
Fortunately for newcomers, the ActionScript language and community have matured enough to support OOP design and best practices with a number of frameworks, including PureMVC, one of the oldest, to help you with your code-separation tasks.
So, I'd like to welcome folks to AIR and PureMVC with this port of a classic Flash demo. After I got the official BlackBerry 'hello world' working on my setup, it took me all of 15 minutes to get the HelloFlash demo running on the playbook.
The HelloPlaybook Demo is simple and could easily be packed into fewer lines and fewer classes, of course.
The demo is meant to be simple, while demonstrating the normal startup process for a PureMVC app (build the view then initialize the PureMVC apparatus), and to exercise the main actors in each of the Model, View, and Controller regions (Proxies, Mediators and Commands respectively).
It also shows how view components talk to their mediators via events, which their mediators often use to talk to Proxies or to send Notifications to trigger Commands or communicate with other Mediators. Mediators also hear notifications and act upon them by injecting dependencies into their view components. This keeps things nice and decoupled.
Anyway, welcome to AIR, I hope this helps.
12-02-2010 04:29 PM
Very nice, I like PureMVC and using it in other project. (Rather large project then small). It is mature framework which offers lots to help build slick applications.