Is the best framework no framework?

Next week marks my first full year in a digital agency and also my first full year working with Flash. Prior to 2008 I'd never really touched Actionscript, tweens or movieclips so it's been a bit of a whirlwind getting to where I am now!

Over the course of the past year I've worked on a variety of Flash projects, some simple banners, some larger sites and most recently database driven, content managed RIA's and widgets. The growing pains have been numerous and looking back at the early projects it's clear that I really didn't know what I was doing!! Having said that, there definitely is a case for the statement 'the more you know, the more you know you don't know', especially when it comes to project planning and code structure.

Frameworks are something that I'd not really come across before (well I can't remember ever using one or learning about them at uni) so early projects didn't use them. I was still learning about events and how AS3 handles the Display List but thankfully I was using Object Oriented coding because that's what I grew up with. These projects had plenty of custom classes and navigating through the site relied on basic events and lots of code. Ultimately, the code wasn't re-usable because it was so bespoke for each project and every class was so reliant on other classes it was always going to be easier to re-write than re-use.

Around June this year Coolpink won some business to design and develop multi-lingual widgets for one of the biggest record labels in the world. These widgets were to have (at least) 9 languages, different content that was updated through a bespoke content management system, a variety of media to be played and the artist's Twitter feed. Clearly some planning was needed!

The custom, fudged code structure of previous projects wasn't going to wash so I investigated several different Actionscript frameworks. The consistent thread that ran through all of them was the MVC design pattern, and in the end PureMVC was chosen. It's worth noting that I've looked into Flex but always chosen not to use it, I don't know why but it feels clunky to use and I much prefer making custom components in the Flash IDE.

Working with PureMVC takes some getting used to, but on reflection it did exactly what we needed. It separated business logic from the data and kept the visual components free of any back end code that would prevent them from being re-used or would make changing the data type/source very difficult. We didn't really need the controllers though and working out what needed to be in a Mediator class or the actual flash component caused quite a lot of head scratching. Talking to other developers recently it seems that this Mediator/view component relationship is one of the big issues with PureMVC. Do you control transitions in the PureMVC classes or build that into the view components separately?

Most recently I was tasked with designing and building a product finder RIA that again worked with a bespoke content management system and pulled in various bits of data and media. This time, however, I chose to work without a framework but implement a loose version of the MVC design pattern.

Without PureMVC it took much more discipline to structure the application but it also allowed for more flexibility. Obviously the experience of working with PureMVC had helped with the structure and planning of custom classes but without it the project took shape much more quickly and the interaction between different parts of the app felt a lot less 'round the houses'. Working without a framework was a good experience.

Currently I'm working on an app that is going to be deployed on the desktop using Adobe AIR and I've chosen to use PureMVC again. I'm still struggling with the reasoning behind using PureMVC (or any open source framework for that matter) but I guess it comes down to producing something that other people can pick up and work with later. The other reason that I keep deliberating is about data flow and communication throughout the app. PureMVC's notifications were clear and understandable, going renegade and doing it my own way involved lots of custom events and adding event listeners to various components which ultimately became hard to keep track of.

So, is the best framework no framework? Maybe, but more likely is that the best framework is a custom framework that is re-used and updated - not custom made for each project.