The Flex Application Frameworks SmackDown (sorta)

2 comments | 922 views

The Selecting the Right Flex Application Framework post provided a summary comparison of the Flex application frameworks out there, highlighting the ones I thought were the “heavyweights” a Flex developer should focus on. The purpose was primarily to help you make a quick, easy, but well-informed decision, without looking at the code.

But many of us wish to look under the covers and see a detailed comparison of the frameworks. So I took Adobe’s Flex Builder 3 Getting Started tutorial example of a simple Flickr photo search and re-implemented it in Cairngorm, PureMVC and Mate.

No Framework

But before we discuss each framework, let’s quickly go over the problems that the frameworks are trying to solve. All Flex application frameworks have been created, because there are problems with implementing a Flex application without one (or, of course, with another framework).

If you take a look at the Code Files in the tutorial, you’ll see that the application doesn’t really need a framework, because it’s simple and straightforward. However, oftentimes, applications are just the opposite. So implementing a complex Flex application, without a framework and following the model described in the tutorial, will require the following:

Cairngorm

For all 3 frameworks, the development process starts with implementing the Photo value object. Beyond that, the frameworks differ.

Flickr Example Using Cairnorm (Flex project archive, ZIP)

Cairngorm addresses the difficulties in the absence of a framework with recommended best practices and the framework. Ease of testing and maintenance are derived from the separation of concerns.

I found Cairngorm really easy to learn and work with. With its wide support and defacto standard status, it almost always is the chosen framework. It’s good for medium to large development teams of varying skill levels in Flex and ActionScript.

However, there are a few disadvantages with Cairngorm.

PureMVC

Flickr Example Using PureMVC (Flex project archive, ZIP)

PureMVC addresses the difficulties similar to Cairngorm with a few more layers of indirection.

PureMVC resolves a lot of the aspects I didn’t like about Cairngorm. It is good for complex applications, with a lot of common components, e.g. forms-based applications with workflows. And it works well for medium to large development teams.

However, it does have a few disadvantages:

Mate

Flickr Example Using Mate (Flex project archive, ZIP)

Mate responds to the challenges of having no Flex application framework in a simple, “indirect” way. It is a “tag-based, event-driven Flex framework”, but can facilitate an MVC implementation.

Mate also resolves a lot of my issues with Cairngorm, but is simpler overall than PureMVC. It is still unable to take advantage of data binding, but I prefer injectors to setting data through code.

Mate would work well for complex applications and is suited for small to large development teams. And unlike other IoC Flex frameworks, it provides more meat behind the event handlers.

Note: The embedded code files have comments that contain more details about each ActionScript class/component. It explains what needs to be created/updated for new functionality and what are the base objects. I have also included a “simplistic” sequence diagram (well, I tried as best I could to make it simple) of the event flows for each framework, when a photo search is performed.

source: http://www.summa-tech.com/blog/2009/02/27/the-flex-application-frameworks-smackdown-sorta/

StumbleIt!
Comments

Social comments and analytics for this post…

This post was mentioned on Twitter by huongnt2: The Flex Application Frameworks SmackDown (sorta) http://blog.tuvinh.com/the-flex-application-frameworks-smackdown-sorta/...

--ReplyReply to this comment


good articles ! thank you for sharing

--ReplyReply to this comment


Leave a comment

(required)

(required)


Spam protection by WP Captcha-Free