I’ve had a rocky relationship with Adobe Flex. An awkward attempt to migrate an existing app to Flex caused several strong reactions and cost a good bit of developer goodwill. The details of that decision are messy and irrelevant. The experience sucked.
On the other hand, I could not have built the FeatureFrame technology without Flex. There’s no simpler way to build a widgetized video player with embedded applications. The same pains of horrible documentation, irrational design decisions, insidious bugs, and painful workarounds remain, but the things it makes easier pale in comparison to the obstacles of any other approach.
And of course in building a virtual world such as Elf Island, Flex is an obvious choice if you want to play it in the browser and build maintainable code (binary Flash files make a poor foundation for a sustainable product).
For most languages you might want to build a Flex app in, free, open options are available. I had a recent need to prototype a solution that might also turn into a test fixture for our vendors to use in producing Flash apps, so Rails seemed the natural solution for simplicity of deployment and prototyping speed.
The main choices to support Flex Remoting calls in Ruby are RubyAMF and WebORB.
In trying to decide, I encountered a very useful comment in this thread:
"The biggest difference between what WEBorb provides and what RubyAMF(only
AMF alternative I am aware of) provides is workflow. Weborb is a great
product written by guys who do java primarily. So it follows the patterns
of having a Service layer that connects you to your application.
RubyAMF is written by a ruby developer."
Immediately, I know what my choice is. WebORB is obviously the trap of over-architecture and suffering that pervades “correct” Java development. A quick search on how to use RubyAMF (in a controller) confirmed my suspicions:
respond_to do |format|
format.html # index.rhtml
format.xml { render :xml => @people.to_xml }
format.amf { render :amf => @people }
end
When I see code like this and compare it to the WebORB or GraniteDS implementations, I just can’t imagine choosing those other paths.
Rails + RubyAMF is concise, clean and obvious in what it’s doing. Yes, please.