New Book: "Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2" 3

Finally our book on using Flex with Rails is released and will appear over the next few days in stores around the US and is available on Amazon. I received a couple of copies from the publisher and it felt like an accomplishment to hold a physical version in my hands. I am sure my co-author, Tony, felt the same. Good job man! With this release we are also launching http://flexonrails.com where you can find all the source code of the book as well as other resources related to Flex and Rails, and our blog http://blog.flexonrails.com the blog for everything on Flex with Ruby On Rails…
So here are the top 10 reasons why should you absolutely buy this book even if you are not a programmer….1) Your vision will improve 2) You’ll run faster 3) Aging gets reverted 4)... Just kidding, the main reasons for us to write this book was that we really wanted to share many of the experiences and findings we had on using Flex and Rails on many projects, and we are proud of the outcome. It’s a book by developers for developers. I’ll be blogging in a next entry about the process of writing this book, and will create a screencast presenting the different applications we are creating in the book, so stay tuned. When writing the book we assumed that you where a developer, either a Flex developer or a Rails developer that needed to interact with the other side and wanted to add Rails or Flex to it’s battery of languages. You will certainly find your way around even if you don’t know Flex or Rails. In either case we didn’t create a reference book so you won’t find all the answers about each api that is available in both frameworks, but you will find everything you need to get started integrating Flex with Rails, and delve into wonderful world of Flex on Rails applications. For the example code we didn’t want to build a large application and refine it over time through the chapters, so most chapter contain one or several working applications used to highlight the major integration aspects explained in that chapter. And Rails is just fantastic to create small applications on the fly, and Flex and Actionscript is pretty good for that too. So to give you a better overview of the content of this book I have attached the official description and the table of content. For more info come back to http://blog.flexonrails.com and http://flexonrails.com. I hope you enjoy the book and the sample applications. So go check it out and let us know what you think.
Daniel.
Description
“There’s no question you’re going to be a better Flex and Rails developer when you’re done reading this book.” –From the Foreword by Matt Chotin, Senior Product Manager, Adobe Systems, Inc.
Adobe Flex enables the rapid development of rich and engaging user experiences. Ruby on Rails dramatically simplifies the development of database-driven web applications. Now there’s a book that shows how to use the newest versions of both frameworks together to create state-of-the-art Rich Internet Applications (RIAs).
Flex on Rails begins with the absolute essentials: setting up your environment for Flex and Rails, passing data with XML, and integrating Flex front-ends with Rails back-ends. Then, using practical, easy-to-understand code examples, the authors take you from the basics to advanced topics only discussed in this book. Techniques covered here include
- Constructing sophisticated interfaces that can’t be created with AJAX alone
- Using RESTful services to expose applications for access via APIs
- Testing Flex and Rails together
- Using Flex Frameworks
- Getting Flex into your build/deploy process
- And more…
The authors also offer practical introductions to powerful complementary technologies, such as RubyAMF and Juggernaut.
Written by developers with extensive experience using both frameworks, this book covers the new Adobe Flex 3 and Ruby on Rails 2 from the ground up. Even if you have minimal experience with Flex or Rails, you’ll learn all you need to know to use them to build exceptional production applications.
Table of Contents
Foreword xv Preface xvii Acknowledgments from Tony Hillerson xxi Acknowledgments from Daniel Wanja xxii About the Authors xxiv <strong>PART I: Flex and Rails Essentials</strong> Chapter 1: Developing with Flex and Rails 3 Installation: What You Need to Get Running 3 The Structure of a Flex and Rails Application 6 The Example Code 9 Compiling MXML 9 Running the Rails Server 9 Summary 9 Chapter 2: Passing Data with XML 11 XML in Rails 11 XML in Flex 14 Getting XML to Flex 17 Sending XML to Rails 19 Mapping Data Types 21 Error Handling 25 Summary 28 Chapter 3: Flex with RESTful Services 29 Creating the Stock Portfolio Rails Application 29 Accessing Our RESTful Application with Flex 39 Summary 48 Chapter 4: Using Fluint to Test a Flex with Rails Application 49 Using Fluint to Write Your Flex Unit Tests 50 The Basics of Testing a Flex Application 51 Testing a Cairngorm-Based Application 59 Using Fixtures 79 Summary 83 Chapter 5: Passing Data with AMF 85 What Is AMF? 85 Benefits of AMF 86 RubyAMF 87 A Simple RubyAMF Example 95 A RESTful RubyAMF Integration 101 Summary 103 Chapter 6: Debugging 105 Logging 106 Debuggers 110 Command Line Debuggers 117 Debugging Communication 127 Summary 129 Chapter 7: Data Visualization 131 Online Analytical Processing (OLAP) 133 Advanced DataGrid 144 Charting 147 Summary 152 Chapter 8: Flex MVC Frameworks 153 What Do We Mean by a Framework? 153 Roll Your Own 154 Cairngorm at a High Level 154 PureMVC at a High Level 159 Stuff 163 Summary 182 Chapter 9: Performance and Optimization 185 Flex Performance 185 Rails Performance 206 Summary 211 <strong>PART II: Cookbook Recipes</strong> Chapter 10: Source Control Flex and Rails Projects 215 Goal 215 Solution 215 Ignoring Files in Subversion 215 Git 217 Discussion 218 Summary 219 Chapter 11: Building Flex with Rake 221 Goal 221 Solution 221 Rake Is Your Friend 221 The Rakefile 222 Summary 225 Chapter 12: Deploying Flex and Rails Applications 227 Goal 227 Solution 227 Capistrano 227 Deploying with Capistrano 228 Summary 232 Chapter 13: Read the Source! 233 Goal 233 Solution 233 The Beauty of Open Source 233 The Rails Source 235 Flex Source 238 Generated Flex Source 240 Summary 243 Chapter 14: Using Observers to Clean Up Code 245 Goal 245 Solution 245 BindingUtils and ChangeWatchers in Flex 245 Taking Action on ActiveRecord Lifecycle Events 248 Summary 250 Chapter 15: Authenticating 251 Goal 251 Solution 251 Authenticating Users 251 Installing restful_authentication 251 Summary 257 Chapter 16: Reusing Commands with Prana Sequences 259 Goal 259 Solution 259 Sequences 259 Prana’s EventSequence 261 Summary 265 Chapter 17: Hierarchical Data with RubyAMF 267 Goal 267 Solution 267 Nested Sets 267 Summary 273 Chapter 18: Advanced Data Grid and Awesome Nested Set 275 Goal 275 Solution 275 Overview 275 Create the Rails Application and Database 275 Creating a Script to Load the Data 276 Flex Application 279 Adding CRUD 282 Summary 287 Chapter 19: Runtime Flex Configuration with Prana 289 Goal 289 Solution 289 IoC, Eh? 289 Summary 293 Chapter 20: Server Push with Juggernaut 295 Goal 295 Solution 295 Push Technology 295 Juggernaut 295 Creating the Rails Messaging Application 297 Creating the Flex Messaging Client Application 299 Summary 301 Chapter 21: Communicating between Flex and JavaScript 303 Goal 303 Solution 303 Communication between Flex and JavaScript 303 Security 303 Building the Samples 304 ExternalInterface 304 SWFObject and Prototype 305 ExternalInterface in Action 305 Flex-Ajax Bridge in Action 309 Summary 311 Chapter 22: File Upload 313 Goal 313 Solution 313 File Upload 313 Creating the Rails Application and Installing attachment_fu 315 Using Flex’s FileReference Class to Upload One or Several Files 316 Using Flex URLLoader Class to Upload a PNG File 318 Summary 320 Index 321
The future of Rails: Rails 3.0
The Merb team joins force with the Rails core team to work on Rails 3.0 and brings many of the modularity and performance concepts from Merb to Rails. At first I thought “Oh, no”, that’s gonna be a mess. But after reading several of the announcements I can see the benefits of the effort and this will make Rails more simple, more modular, more robust, better defined, and certainly faster. Bringing two different teams together is very difficult but the fact that both team are complementary and look for excellence in their work and managed to come up with a great vision of the future of Rails, got me excited about the future of Rails. They gonna make it happen. You can read more about here:
- http://weblog.rubyonrails.org/2008/12/23/merb-gets-merged-into-rails-3
- http://rubyonrails.org/merb
- http://yehudakatz.com/2008/12/23/rails-and-merb-merge/
- http://brainspl.at/articles/2008/12/23/merb-is-rails
- http://merbist.com/2008/12/23/rails-and-merb-merge/
Merry Christmas/Hanukkah/Hollidays!
Daniel.
Flex Job: Full time Flex developer in Denver at Videopros.com
Solomon, who also writes on this blog, is currently doing Ruby on Rails work for videopros.com and they are looking to hire a Flex developer to complement their small development team. Here are the details…

We seek a Flex on Rails Kingpin to lead our development team. This is for a full-time or contract-to-hire position. Private consultants should not apply. Depending on skill level and commitment an equity stake is available.
Compensation
- 70-100K
- Potential Equity
- Potential Profit Sharing
Skills and Experience
- Ruby on Rails | 2.5 Years minimum
- Flex | 1 Year minimum
- Web Services
- Experience as the lead developer for a commercial project.
- Agile development
- Subversion (GIT)
- Linux
- MySQL
- XML
Benefits
- Competitive Salary
- Health Insurance
- Long Term Disability Insurance
About Us – The VideoPros Dojo
Dojo means “place of the Way.” Much like a martial arts practice hall, the WAY we operate at VideoPros is a pursuit for mastery in the face of adversity and challenge. The true challenge is not between people and external things – but within ourselves. Working at VideoPros means going within yourself and seeing the work you do as a reflection of who you are on the inside. It’s more than “work” or “my job.” We are a place you go to practice being the best you can be – every day.
Apply
VideoPros is motivated to fill this position quickly. To apply, email your resume and one reason why you want to join us at the Dojo to: Careers{at}VideoPros{dot}com
Screencast: Using Webby to create a static website.
Screencast: Using Webby to create a static website from daniel wanja. Enjoy! Daniel.
RubyConf 2008 videos available at confreaks.com - Thank you!
I couldn’t make it this year to RubyConf so I am really thankful to see that most of the presentations are online at confreaks. It’s just awesome that these videos are made available online and so quickly after the conference and for free. It’s a real tribute to the Ruby community and it’s open and sharing spirit. Thanks guys! My understanding is that the rubyconf pays Confreaks to take, processes and distribute these videos. Let me know if the arrangement is different, to give credit where credit is due. Thanks RubyConf and the presenters, and good job Confreaks.
Here are the videos I selected for my commute this week.
- Keynote – Dave Thomas
- Questions & Answers – Yukihiro ‘Matz’ Matsumoto
- Introducing Red Sun – Ruby to Flash – Jonathan Branam
- MacRuby: Ruby for your Mac – Laurent Sansonetti
- OS X Application Development with HotCocoa – Rich Kilmer
- Hacking with ruby2ruby – Marc Chung
- Using Git in Ruby Applications – Scott Chacon
- Adrenaline-Driven Development – Bruce Williams
- Fear of Programming – Nahaniel Talbott
- Recovering from Enterprise – Jamis Buck
View the full list of videos available here.
You may wonder why I would watch videos during my commute. Effectively I drive 40 minutes each way to my customers (happen to be both near enough for me to drive and not tele-commute) and this gives me a chance to catch up on many of the excellent screencast and podcast out there. Now when one screencast really sticks out, I watch it again at night…without driving ;-).
This said I converted the confreaks small videos format (640×240) to the iPhone format using Quicktime pro, but I only get the sound…which is fine for my commute. Any hint on how I can convert them to also get the video going would be appreciated?
Enjoy! Daniel
Moving "private" and non-Rails related entries to http:blog.wanja.com 2
Rails Deployment On Heroku Using Git 1
Rails Deployment On Heroku Using Git from daniel wanja on Vimeo. Note flexonrails.com is still "under constructions" and I am adding stuff for the launch of the book...which is now set to shortly after December 19th. Yea!
Determine Test Coverage on your Flex Projects with Flexcover.
This week I was playing with Flexcover a test coverage tool for Flex…and it’s really cool. If you you to determine how much test coverage you have in your Flex application then check out this screencast…maybe skip to the end where you will see flexcover in action. The first part is how to assemble the Flexcover SDK to use with FlexBuilder. Again this is a non-scripted screencast with several “oops” and a big Swiss-French accent which I hope you will find useful.
The key here is if you do Flex, write unit tests and use this test coverage tool.
Setting up Flexcover as test coverage tool for your Flex applications. from daniel wanja on Vimeo.
Enjoy, Daniel.
Flex test coverage?
It’s hard to imaging writing a Rails application without using rcov and get that fuzzy feeling you tested most if not all you application. Or at least get a good idea of what’s tested. I heard way back that Alex Uhlmann was working on some test coverage tools, but I didn’t see anything coming out from Adobe. I haven’t used test coverage for my Flex apps, but want to start. Any body has any good hints, stories, frameworks they use for test unit coverage in Flex? A quick google search pointed me to this article describing Flexcover, just what I was looking for. Please share your experience.
Thanks! Daniel.
UPDATE: I am playing with FlexCover and just saw this “Flexcover is a joint effort with Alex Uhlmann of Adobe Consulting, who has been working on a related set of ideas.”. So I guess this is really Alex’s work that Steven was referring to which is now open source under the MIT license. Cool!
iPhone NDA - Call for arms [Update: NDA lifted :-)] 6
UPDATE: today (10/01/2008) Apple lifted the iPhone NDA. New agreement will come out in a week (or so).
Until now I wasn’t concerned about the iPhone NDA as the iPhone is really cool, there are nice apps appearing on the App Store and face it, this platform is there to stay, the iPhone is just impressively useful and versatile. But recent news on applications being rejected by Apple for undefined reasons and the fact that the pragmatic programmers book on iPhone was pulled due to the NDA, ticked me off. That’s what the “Prag’s” released in their news: “It now appears that Apple does not intend to lift the NDA any time soon. Regrettably, this means we are pulling our iPhone book out of production.”
Damn that! That was THE book I was waiting for. I am a developer, did Objective-C development on NeXTSTEP 15 years ago and follow closely what’s going on with the iPhone. I was one of the first admitted to the iPhone developer program and I am certainly bound by NDA beyond my comprehension, but I was also really hoping that the platform would open up. Early on it made sense as Apple wants to have the “Wow” factor when they first announce their product, and that’s worth millions to them. But now that the phone is out for quite a while, that all Apple competitors have access to all the beta SDKs, let me ask you this:
WHY?
Why does Apple keeps this NDA…I just doesn’t make sense. Let the development community go crazy, share the knowledge, create something unique beyond what you have. Apple, you are making your development community ANGRY.
I tried to find a good reasons why there is still this NDA in place, but there is just no reason. What did I miss? What has Apple to gain? What can we do?
Please leave your thought as comment here after.
Daniel.