I recently had the pleasure of attending a summit on component development for Flex2. I came into it much more as a component developer than a Flex user, so it gave me a great opportunity to learn about some of the lower level features of Flex direct from the source. Since then, I’ve been tinkering around with Flex, and while I still don’t feel as comfortable with it as I do with Flash, I do feel like I have a good grip on when and why I would use it. Being that this is a subject that a lot of Flash developers seem curious about, I decided to post my thoughts. These are my very generalized opinions as a long-time Flash developer getting into Flex 2, your mileage may vary.
Flex 1 / 1.5 never held any interest for me. Development was messy, licensing was confusing and pricing was prohibitive. I felt I was paying $15g for a layout manager, and hey, we have a few of those in our code library already. Flex 2 addressed all of those issues. The development environment is great (for the most part), and licensing and pricing has been completely redone. Flex 2 has definitely piqued my interest.
To clarify my terminology in advance, I’m using “Flex 2” to refer to content built with the Flex framework and visual editor, and “Flash” as a more general term for Flash content not built with the Flex framework. FlexBuilder2 remains a very powerful IDE for developing AS3 only content (which is generalized as “Flash” content here). Colin and I were just discussing how there is a definite need to evolve our vocabulary to deal with these new methodologies.
My take on Flex 2
Flex 2 is an amazing tool for building a specific type of project, namely form based applications. You see, Flex is like ground beef, Flash is like the whole darn cow. While it’s completely possible to make a hamburger (form app) with the cow, it’s going to take a lot more work than if you just started with the ground beef. Try making a nice sirloin steak or some cheese with the ground beef though. Sure you could force the ground beef to look, and maybe even taste kinda like cheese, but it would be a messy hack. Flash gives you the power to do a lot more things, but you have to do them from scratch.
Flex essentially builds rich Visual Basic apps for the web – form based, data bound, layout-managed applications that all look alike. And there’s nothing wrong with that – in fact, it’s really awesome how easy it can make building applications. It’s just really hard to inject the magic that a well-built Flash project exudes. I think the coolest Flex projects will be the ones that integrate elements built in Flash to spice up otherwise relatively homogenous hamburgers. Flex will facilitate rapid development, Flash will add the creative magic (yum, cheeseburgers).
One of the things that currently frustrates me in Flex 2, and which is a problem with most highly abstracted RAD languages, is that if your project doesn’t fit well in the Flex mold, you spend 95% of your time trying to figure out how to force Flex to accommodate 5% of your functionality. I seem to run into issues like this regularly – one day laying things out and wiring data binding, two days trying to figure out how to make a custom window show up properly. A lot of this has to do with experience, but part of it is just par for the course with this type of development. Again, I think Flash can make some of this easier, by building elements for Flex from scratch instead of trying to force Flex into doing something it wasn’t meant for.
What would I use it for?
We’re definitely looking at rolling out some projects with Flex 2. Even re-writing some existing projects in it. I would never build a corporate site or game in Flex (seriously, don’t do it!), but I would definitely build a corporate intranet. I’m strongly considering moving our (rather slow moving) gModeler 2 effort into Flex, and building a bunch of custom elements in Flash.
Flex 2 is a huge step up from Flex 1/1.5, and definitely something to investigate if you’re a Flash developer building rich applications. Even if you don’t want to build applications with it, there’s a potentially large market for building components, and custom elements in Flash for Flex developers.
That’s my 2b for now. I might post again down the road after we’ve deployed some projects with Flex.