Posts Tagged ‘as3’

PureMVC Tip: Notifications

Monday, September 29th, 2008

This is a somewhat obvious tip, but in the past when sending PureMVC notifications I’ve sent them with an Array as the body. This is nice for simplicity, but requires you to more or less remember what the order of parameters are and what type each is. My solution is simply to create a single value object class for notification bodies (that phrase sounds weird) sending complex data. Then you can cast the body of the notification back to its type and maintain type safety, as well as having access to any code completion.

It’s not an end-all solution, I wouldn’t expend time coding a class for simple notifications, but it certainly helps keep your command code clean and readable when you’re send more complex data.

PureMVC 1.7 for AS3 is Here!

Sunday, December 30th, 2007

Cliff Hall just announced the release of PureMVC 1.7 for AS3.

If you haven’t had the opportunity, PureMVC is a great Model-View-Controller based framework. I have only spent a few days with it and I have to say I’m getting an understanding of it faster than my previous attempt to understand Cairngorm. The main benefit I see of this framework over Cairngorm is that Cairngorm focuses too much in Flex. PureMVC’s independence of Flex also means easier programming of AIR applications. Also, Cairngorm’s framework is far too interwoven, with Model code spilling over to Controller code and on and on. PureMVC keeps these areas completely separate but allows them to work with each other through a Facade class middleman. Also, you can also override PureMVC’s default behavior if you don’t like what it’s doing as it has been coded with subclassing in mind. PureMVC is solely an AS3 project and it is presently being ported to a number of other languages.

I have to say that so far PureMVC makes application programming an absolute pleasure.

If you still have doubts, take a look at this beautiful diagram of how PureMVC works.