Frameworks Galore
Well, not too many, but I would say just enough to ease the use of the Flex framework itself, and deciding how best to lay out your code. Up to this point, I have not tried to use a framework for my code, mainly because I did not really see the need for one. I had my own basic structure that I used for all of my code and tried to stick with that when methodology when creating/laying out my projects. At my last job, my co-worker and I were of a pretty similar mindset, so it was pretty simple to not stray too far from each other’s best programming practices.
At my current employer we have been transitioning from a ColdFusion front and back end to a ColdFusion back end and Flex on the client. We have a relatively small team, with varied knowledge of Flex and OOP, but everyone is willing to learn, and seems to do so pretty quickly. With this in mind, we thought that a framework may assist those without the in depth Flex knowledge to come up to speed a little quicker by not having to wonder where to place certain components that they end up building, and can use the other code they find for groundwork. This combined with the fact that even though the group is small, frameworks do seem to facilitate easier code reuse, and take the guesswork out of best practices. Also, due to time constraints, our most recent project turned into a somewhat procedural behemoth of an application, that now is in need of some refactoring, and a framework would certainly help by easing how to split everything up.
I started to get the urge to look into frameworks again after reading FrameworkQuest 2008 over at insiderRIA.com. Tony Hillerson did a great job of presenting all of the various frameworks, in a very unbiased fashion, I thought. I figured, rather than just taking his word for it, I would dive into the frameworks myself and take a small project I created using my usual code structure and break that out using a framework. Nothing helps to send the message home than to write it yourself.
The 4 frameworks I decided to implement were:
my own
Cairngorm
Mate
and Swiz
I had ruled out PureMVC from my list of frameworks, mostly because I felt that if I was going to use a non-standard framework, that I wanted something that would make my life easier, and, at first glance, while it seemed to be quite powerful, PureMVC seemed to a little too abstract for what I needed it for (especially for those just getting into Flex).
Over the next couple of weeks, I’ll post my trials and tribulations with each framework as I went through it, how I dealt with the problems I came across, and my humble reasoning for the framework I chose. Hopefully it will give others insight into the frameworks (for those of us who have never used them before), and if others are actually reading this blog, will help out by commenting on things that I’m either doing incorrectly, or could be done easier.