Frequently Asked Questions

(Updated 2007-10-24.)

Q. How do I buy the book?

A. Please buy it direct from Manning at this link.

Q. How do Flex and Rails fit together?

A. This diagram (a screenshot of part of one of the pages of the book) shows it best.

Q. What is Flex, and why should I care if I'm a Ruby on Rails developer?

A. Briefly, Flex is a way of building applications that run inside the Flash player. You write code in ActionScript (similar to JavaScript) and layout a GUI using MXML (an XML dialect). This is all compiled into a SWF file that runs inside the Flash player.

So what does this have to do with Rails? Simple: in all the discussion so far, I have not mentioned a server-side technology stack. That's where Rails fits in. (Well, 2/3 of Rails: Action View obviously isn't as central to the Flex + Rails equation as Active Record and Action Controller are.)

Flex is intended to be easy to learn for developers with absolutely no Flash experience but who have experience developing web or desktop applications. This was true for me when I learned Flex 1.0: I had never used Flash, but very quickly I had written the better part of a chess game (fairly slick Flex client, a server written in Java, etc). (My background is years of working full-time with Java Swing, with a few months of PHP over six years ago.)

Earlier versions of Flex targeted Flash 7 and Flash 8; the book is about Flex 3, which targets Flash 9.

You should care about Flex if you are a Ruby on Rails developer and want to rapidly develop applications that can take advantage of the many features of Flash 9 (but developing at a higher level than Flash) and still getting the benefit of using Rails as your server-side component.

Q. What about OpenLaszlo? How does Flex compare?

A. I haven't done much with OpenLaszlo beyond "hello world" a long time ago, so I can't say anything meaningful about the comparison. (But buy my book anyway to see what you're missing ;-)

Flex 3 vs. OpenLaszlo vs. AJAX is an interesting question. For me, it comes down to choosing the best tool for your requirements. If you need to target Flash 7, for example, OpenLaszlo obviously wins over Flex 3. Luckily, Rails is such a great framework that it can work with all three...

Q. Who are you? What is your background with Flex and Rails?

A. I have been working with Flex full-time since July 2004 (since before Flex 1.0), and tracking Ruby on Rails since mid-2005 (since before Rails 1.0). Before switching to Flex, I spent five years working with Java Swing, with a brief stint with PHP during the dotcom bubble in 2000. As someone with a heavy Swing background, I initially found Flex appealing since it felt very familiar--more like Swing development than web development.

Q. How should I know whether the book is worth buying?

A. Hundreds of people bought the Lulu book and liked it, so it's a pretty good bet you will too. You can go to Manning's website and see the table of contents and other information.

Q. What prompted you to write this book?

A. The desire for fame and fortune, obviously. (Don't believe anyone who writes anything of any meaningful length and tells you otherwise :-) Also, in January of 2006 (when I had the idea for the book), no one in the world cared (that I could tell) about the combination of Flex and Rails but me. When you have an idea that you think is ahead of its time, you want to share it...

In case anyone cares, here's the detailed timeline:

On January 31, 2006, after over a year and a half of working with Flex and over six months of playing with Rails (building toy apps, reading Agile Web Development with Rails, etc) I finally realized that for many applications Rails was the perfect server-side technology to complement Flex--and on the flip-side, that Flex offered capabilities that were either difficult, impossible, buggy or merely annoying to do on with JavaScript / AJAX / DHTML on the client side. (Especially if, like me, you're not a JavaScript guru like Thomas Fuchs.) Furthermore, while RJS templates are very promising, at the end of the day you are still dealing with the joy of HTML, JavaScript, CSS and browser compatibility issues.

So, I did what I always do whenever I have a Really Great Idea: I registered a domain name. I wanted a name which would be good name for promoting a possible book about using Flex and Rails together, so the natural choice was flexiblerails.com. I also got flexiblerails.net and .org since I was so sure of how good an idea this was. [By January 2006 the massive success of Agile Web Development with Rails had put dollar signs in the heads not only of publishers but also of many in the Rails community who had blogs. (After all, writing a book can't be much harder than writing a few blog posts, right? Right?)]

I then did what I also typically do whenever I have a Really Great Idea:

Nothing.

Between the demands of my job and my two-year-old son, I was too busy, too tired, etc. Besides, I had a lot of Really Great Ideas (and domain names to go with them!), and I wasn't acting on any of them--what made this one worth doing? So, time passed.

Then, it was announced that the Flex 2 SDK would be free (as in beer) and I thought again: yep, Flex and Rails will be perfect together, especially since Flex 2 will be so much better than Flex 1.5.

Again: nothing. I'm too busy; I'm too tired; I'd rather play Civ 4; the list goes on.

Then, Flex 2 went through its Beta cycles and was released, with Flex Builder costing only $499 (the expectation had been that it would cost $999, since Adobe had announced it would be less than $1000).

Again: nothing.

Then in July 2006 I stumbled upon an absolutely excellent tutorial written by Stuart Eccles on liverail.net (written on April 16, 2006) about using Flex and Rails together, and then upon another one (written on the same day!) on Christophe Coenraets' blog, and realized that I wasn't alone in thinking this was a Really Great Idea--and that if I was ever going to write anything about it, I'd better get off my butt and do it now. The most ironic thing was that the liverail.net tutorial rails application was called (you guessed it) flexiblerails. For me, this was truly the "get off your butt and do something you moron" moment: The first really good tutorial about Flex and Rails together had used the same name for its example application that I had registered as a domain name months earlier! (If anyone cares: I registered flexiblerails.com on January 31, 2006. Stuart Eccles published Part 1 of his excellent tutorial on April 16, 2006, and I had missed seeing it until July 2006! If I didn't love my domain name so much I would have named this book something else, so as not to cause confusion between this book and the tutorial on his blog. I hope that this chronology is a sufficient acknowledgement of--and even an homage to--his tutorial: This book would not exist if his tutorial hadn't motivated me to finally do what I had already thought of doing.)

After this, I released the book on Lulu and spent over a year writing and revising it. I am now updating it to Flex 3 and Rails 2 and releasing it as a Manning book.

I hope that this book is useful to you.

Q. Isn't lots of the above material stolen from the Preface and Introduction?

A. Wow, someone actually read the Preface!

Q. Did you actually register the domain name 38noises.com?

A. Yeah, I did--I thought it was really funny. (My wife will testify to the fact that I buy too many domain names for stupid reasons!)