The Blog

Mar 7, 2009

Flex Camp Miami: Mate Flex Framework (Laura Arguello) 

by Maxim Porges @ 11:07 AM | Link | Feedback (0)

Laura Arguello gave a really thorough overview of the Mate framework for Flex and AIR applications. I was present for Laura's original presentation at the launch of Mate at cf.objective(), so I was interested to see how she presented it two years after.

Not only were Laura's slides easy to follow and beautifully drawn (as always), but she had added some detail on alternative approaches and how Mate solves the problems associated with these approaches. Laura stepped through a full example of a movie browsing application built with Mate, showing the way the event bubbling and routing mechanism worked. I was particularly impressed with Laura;'s use of animations to get the point across, including an innovative "production line" slides that shows how Mate decorates events as they are routed through the framework, and gets them to the right place.

I've always liked the principle behind Mate because it is supported by an event-driven message bus. Message bus architecture really fits nicely in to a Flex app since Flash is event-driven and has native support for asynchronous event management, bubbling, and routing. The only part of Mate that I find less desirable is the MXML-based routing and mapping; there is nothing wrong with this per se, but it reminds me of ColdFusion and Fusebox tags quite a bit, which is probably the root of my opinion since I have moved far away from that technology and framework. I'm personally a fan of being able to annotate my classes with metadata and have frameworks introspect them in order to figure out what to do, and the work that Russell Centanni has done with Chris Scott to get better support for the [Mediate] annotation in Swiz has really made me a fan of that framework.

Of course, putting metadata in your classes is something of an invasive approach, so while it makes configuration more transparent, it leaves framework remnants in your code and requires a recompile to remove them; this is in direct contrast to Mate which is configured completely independently of your code. At the end of the day, you have to pick your poison. Since both Mate and Swiz exemplify the same best-practice approaches of making your code easy to test and loosely coupled, you can't really say that one is better than the other - it all comes down to personal preference at the end of the day. I am, however, perfectly comfortable saying that both of these frameworks are far better in my opinion that Cairngorm, which is possibly the most invasive framework I have ever worked with. The Universal Mind extensions for Cairngorm certainly make it less of a bear, but it still smacks of the sort of nonsense we had to deal with in EJB 2.1 for Java. Naturally, we had to start somewhere, so matter how much I may bash Cairngorm today, we wouldn't have gotten to Mate and Swiz without it kicking off the evolutionary process for us. In other words, "yay" for progress.

Laura is going to be presenting Mate again at the upcoming 360|Flex conference in Indianapolis, IN on May 18th 2009, so if you are interested in learning more about Mate this would be a great way to do so.

All Flex Camp Miami Roundup Posts
Welcome and Keynote (Greg Wilson, Adobe)
Working with Data in AIR (David Tucker, Universal Mind)
In Search of AOP for AS3 (Maxim Porges, Highwinds)
Merapi or How To Blow Your Mind with AIR (Andrew Powell, Universal Mind)
The Art of Storytelling (Christian Saylor, Universal Mind)
Continuous Integration and Flex (Brian LeGros, Highwinds)
Spring & BlazeDS Integration (Jeremy Grelle, SpringSource)
Mate Flex Framework (Laura Arguello, ASFusion)