Frameworks, my take on it
Flash and Flex frameworks.
Lately I've working on three big projects that would require the usage of a framework, and not wanting to extend my own framework, that consists mostly of accumulated libraries over time, I decided to give the most prominent ones a go.
So I started by checking out what was on the market, I found as-hive, pureMVC, Cairngorm and Mate ( there are a few more but somehow I didn't feel they were mature enough to be used.
Now for a little background on this quest for the framework, and few of my personal opinions on the whole framework business.
The point of a framework is to aid you in the making of your application/website, this can be the handling of repetitive tasks for you, providing a strict way of coding and thus giving you a common ground of understanding with your peers. Also it's meant to enable you to code more efficiently, make your code more readable and produce a scalable product that you can, even at a later date, modify without breaking everything.
What they are NOT meant to do is to force a coding style that makes feel restricted, uncomfortable with and most important they shouldn't be extra work. It feels pretty pointless to have to code 3 times as more to have the same functionality, some of you might immediately argue "but what about scalability?" well sometimes that's not everything, in the real work time matters.
Ok, now that we got that out of the way let's move on to the frameworks.
The project that required me to start first was a PV3D website that heavily relies on dynamic content. So I checked out pureMVC and as-hive and quickly decided to go with pureMVC.
So then I went on to the forums and examples pages and tried to read all that mattered to me, plus I found nice diagrams that help you out alot in the beginning.
As I delved more into the project I realized that some extending and heavy integration of PV3D and pureMVC would be required in order to make things easy for me, plus the project relies on the URL to know where it is and react accordingly, this was easy enough, simple and clear.
So my opinion on pureMVC is that it's the perfect framework for AS3 projects because it's easily extensible, highly functional, doesn't force you to adopt a specific style but still requires you to have rules and standards.
The next project is an AIR Application that will mimic some of the functionality of Powerpoint so I immediately thought of Cairngorm, but then I heard about Mate (pronounced mah-tey) and it seemed like the perfect solution.
So having already started development with Cairngorm when I heard about Mate, it felt like a risk to change, but nevertheless a risk worthwhile taking should Mate be more practical and provide me with a faster environment in which to code.
Well Mate does look great on paper ( and I printed the architecture) but somehow it feels like it still hasn't achieved critical mass to be used, now don't get me wrong it's a great framework and I'm sure that with some extra work I'd be in love with it, but at the moment I just didn't have the time to try and figure out somethings on my own and the forums don't have that many topics, plus the examples are far too simple. So I'm sticking with Cairgnorm for the time being.
Cairgorm is a must know for any Flex developer, it's the official framework which means that plenty of clients will feel more comfortable with ,or even ask for it.
That said I started using Cairngorm and eventually grew to like it, I liked the ViewModelLocator and the self dispatching event model, and it did eventually make my work easier.
And to finalize I'll go into no frameworks at all because sometimes a framework is just an overkill, some might say that it's always the best solution, but not always. Sometimes we just need to develop a small application/website and using a framework is actually extra work than just making it the fastest way possible and if it needs updates after they should be easy enough, if they aren't, well you can always refactor it into a framework based app. This works well for me because of years of accumulated libraries that provide me with most of the common tasks i need, many of them published here on DIF.
So that's enough and if you read all the way here congratulations, and please leave me your thoughts.
May 21st, 2008 at 7:12 am
Hi,
You can check Universal Minds extension to the Cairngrom Framework, Its interesting..
May 21st, 2008 at 12:50 pm
Interesting read. You should state the reasons (if any) that took you to choose pureMVC over as-hive.
May 21st, 2008 at 3:04 pm
My thoughts exactly. Although I’ve been using haXe lately instead of ActionScript, pureMVC has been my framework of choice mostly because of the standards it makes you adhere.
Great article.
May 21st, 2008 at 3:54 pm
@Anupam - I did but it felt to me more oriented for big enterprise level online applications.
@André - Thx
September 10th, 2008 at 6:46 am
Я круче нигде не видел.
October 22nd, 2008 at 6:23 am
not once do any of the available as3 frameworks state any “rules” they are merely just guidelines and honestly if you are looking for an excuse to write code all over the application you really don’t need to blame a framework for trying to guide you in the right direction…
if your project is too small to justify using a framework… well don’t use a framework its that simple.
i really understand where you coming from though because it seems like all these people are shouting their mouths off about how wonderfull their lives have become after purmvc or cairngorm… yeah they learnt a thing or two but at what cost and can they still do the same thing in less amount of time and code…?
the app you mentioned sounded like it used a lot of dynamic data.. have you considered just using a proxy and the command pattern…? it’s really a minimal amount of code and all you need to make calls to the server easy from any where in the application…
don’t be afraid to just say no to a framework and you really should not be using frameworks if you just want to fit in with everybody else… be a man say no to frameworks if you want too, but at least take the time to learn them so that you can put people in their place when they try to tell otherwise…
October 22nd, 2008 at 6:25 am
also have you tried using cairngen to setup your cairngorm projects? it generates a lot of code for you to start off your project and lets you hit the ground running…
October 23rd, 2008 at 8:30 am
I’m afraid I didn’t explain myself well enough, I agree with you and i do quite often choose to go the minimalist approach or without a framework at all.
The whole point of my rant was that while cairngorm is setting itself as industry standard it lacks a lot of the functionality of pureMVC and a lot of the appeal of lighter frameworks. (as a i state in the final paragraph)