Skip to:Content
|
Bottom
Cover image for Flex on rails : building rich internet applications with adobe flex 3 and rails 2
Title:
Flex on rails : building rich internet applications with adobe flex 3 and rails 2
Personal Author:
Series:
Developers library
Publication Information:
New Jersey, NJ. : Addison-Wesley, 2009
Physical Description:
xxiii, 335 p. : ill. ; 23 cm.
ISBN:
9780321543370
Added Author:

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010185914 QA76.625 H57 2009 Open Access Book Book
Searching...

On Order

Summary

Summary

From the bestselling author of Push , a story of survival and awakening--and one young man's remarkable strength

The Kid brings us deep into the interior life of Abdul Jones, son of Sapphire's unforgettable heroine, Precious. Left alone by his mother's death to navigate in a world where love and hate sometimes hideously masquerade, forced to confront unspeakable violence, his history, and the dark corners of his own heart, Abdul claws his way toward adulthood. In a generational story that moves with the speed of thought from a Mississippi dirt farm to Harlem in its heyday, from a troubled Catholic orphanage to downtown artists' lofts, The Kid is a soaring tale of body and spirit, rooted in the hungers of flesh and of the soul.

 


Author Notes

Tony Hillerson is a Software Architect for EffectiveUI. He graduated from Ambassador University with a BA in MIS. On any given day, he may be working with Flex, Java, Rails, Maven, Ant, Ruby, Rake, Capistrano, or shell scripts. Tony maintains RubyAMF, a Rails plug-in that allows Flex applications to pass AMF messages to and from Rails. Tony has been a speaker at 360|Flex, Adobe MAX, and RailsConf, as well as local user groups. In his nonexistent free time, Tony enjoys playing the bass, playing World of Warcraft, making electronic music, brewing beer, learning Latin, and studying philosophy. Tony lives outside Denver, Colorado with his wife and son, Titus.

Daniel Wanja , a native of Switzerland, currently lives in Denver, Colorado. He has lived in Denver for more than six years with his wife and three children, ages 5, 3, and 5 months. Daniel is a dynamic, skilled enterprise software architect and developer with over 20 years' experience. He has worked in the banking, insurance, and high-tech industries around the world delivering mission-critical software. Daniel is president and part owner of two Flex and Ruby on Rails consulting agencies, Nouvelles Solutions, Inc., in Denver, http://n-so.com , and ProDesign Sarl in Geneva, Switzerland, http://prodesign.ch . Daniel started the http://onrails.org blog on Ruby on Rails and related matters in 2005.


Excerpts

Excerpts

Preface In 2004 yet another framework for making websites appeared. It was called Ruby on Rails, and when web and enterprise developers who had never heard of Ruby before started to work with it, they discovered that it wasn't like all the others. Why? Rails offers the promise of fewer configuration files, less boilerplate code, less red tape, and, most of all, the promise of having fun again while programming. Rails was designed to make development more about getting common development tasks done by following conventions, not offering endless flexibility for the remote possibility of connecting up with any number of hypothetical legacy back-ends sometime in the future. By taking away unnecessary choices and offering simple solutions for common problems, Rails lets developers focus on writing applications, and developers have paid Rails back in accolades and adoption. Around the same time as Rails was emerging, Macromedia (later bought by Adobe) was bringing a product codenamed "Royale" to market as Flex--a server-side Flash compiler. Flash had been experiencing a groundswell of developers wanting to build rich interfaces for web applications, not just animations or "Punch the Monkey" ads. Flash developers loved that they could build interfaces that would be extremely hard, if not impossible, to produce in HTML and JavaScript, but the Flash IDE was more suited to timeline animations. Flex changed all that by offering an easy-to-understand XML language for developing Flash interfaces, as well as a component set that made it dead simple to build applications. Flex 2 made things even better by taking the Flex compiler off the server so that there was no requirement of building and deploying Flash movies (SWFs) using the Flex framework and compiler. Flex 3 is one step better by being open source! The Flex language has come a long way too. Bruce Eckel, the author of such books as Thinking in C++, Second Edition (Prentice Hall, 2000) and Thinking in Java, Fourth Edition (Prentice Hall, 2006), said it best when he said, "Flex is a DSL for graphics, multimedia, and UIs" ( http://www.artima.com/weblogs/viewpost.jsp?thread=193593 ). DSL, or Domain Specific Language, is a language with terms that match up well with a certain problem domain, and the term DSL should resonate with Rails developers. Flex, more than HTML with JavaScript, is a language for building rich interfaces quickly and easily. Flex and Rails developers haven't crossed paths that often, but more and more as the word gets out about each technology, developers want to know what these two are about. Having worked for years with both Flex and Rails, we believe that both have something powerful to offer developers who want to build desktop-like functionality into web apps quickly, in a team environment, with the ability to be agile and react to the ever-changing requirements of building and delivering an application to the web. Audience for This Book ?Chances are you're reading this introduction to figure out if this book is for you. Have a look at these "stories" and see if any of them sound familiar. Rick--Rails Guy Background ?Worked with Java for years: Struts, EJB, Spring, all that. Then discovered the joy of working with Rails and hasn't looked back. Overheard Edge Rails? Is there any other kind?" Goal HTML/CSS/JavaScript is fine for simple interfaces, and I don't mind how crufty it is as long as I don't have to deal with it. I'd be interested in finding out how to build richer interfaces, though--interfaces that don't just look better but also give users better tools and an overall better experience." Jill--Java to Flex Convert Background Worked with Swing and understands desktop applications. Got into "The Web" and did lots of J2EE. Loves Flex for the ability to build desktop-like functionality on the web, usually in front of J2EE back-ends. Overheard GridBagLayout? What were they thinking?" Goal "I love working with Flex, but I'm getting a little tired of all the work it takes to set up the back-end with Java. Enterprise software is great when I need the flexibility of all that configuration, but what about when I have a straightforward model and I just want it to work? There's got to be an easier way." Pete--Flash/PHP guy Background Has done lots of design work and building of interfaces with Flash. Has built websites with PHP and also integrated PHP back-ends with Flash. Overheard "I don't skip intro, I make intro" Goal "I know what I can do in Flash, and I know how to feed Flash UIs with data from PHP. I'd really like to see what this Flex thing is all about though, since I'm not always building timeline animations. I've also heard a lot about Rails and how easy it is to get a back-end up and running." If any of these stories sound a bit like you, then this book is for you. Rails and Flex have both revolutionized the way we develop web applications on both the front- and the back-ends. Developers who have found Rails and left the world of enterprise framework stacks behind would very rarely willingly go back to the slow development cycles and bloated boilerplate code they had to endure. Flex developers have found the declarative XML language much cleaner and less crufty than HTML and able to do things like 3D and video that would be impossible without Flex. Of course, there are the normal disclaimers. Rails isn't for every project and neither is Flex. David Heinemeier Hansson wrote about PHP in a blog post ( http://www.loudthinking.com/posts/23-the-immediacy-of-php ): I've been writing a little bit of PHP again today. That platform has really received an unfair reputation. For the small things I've been using it for lately, it's absolutely perfect. . . . For the small chores, being quick and effective matters far more than long-term maintenance concerns. Or how pretty the code is. PHP scales down like no other package for the web and it deserves more credit for tackling that scope. And the same goes for Flex. HTML doesn't need to be compiled and needs no special tools besides the ubiquitous browser to view it, whereas Flex needs a compiler and the Flash Player. However, when you find yourself with a medium to large web project with a database back-end, working with a team on a set of complex forms, rich visual interactions, video integration, 3D features, or a very large set of views, then Flex and Rails make a great choice. The Flex and Rails story has a lot to do with discovering the integration capabilities and learning the ins and outs of making them talk to each other. We've gone a bit beyond that, though, and tried to assemble enough information about the next steps, common tasks, and how-to's that developers will want to know about sooner or later. We thought that, for the most part, Flex developers who have never used Rails will want to learn some of the features that they'll run into during integration, but also during daily work. Likewise, developers who are already familiar with Rails will want to know a bit more about how Flex works than just consuming Rails' XML services. Note - This book is not an introduction to Rails nor to Flex. If you haven't used at least one of these technologies before, you may find yourself a little lost. If you've used or are pretty familiar with one technology and haven't been exposed to the other, then this book is a great companion to reading a primer about the other, either first or at the same time. What's in This Book? The book is designed to take you through the process of learning about integrating and beginning to explore Flex and Rails. In Part I, Flex and Rails Essentials, we cover the core topics that you need to be familiar with in order to get you Flex and Rails projects going. In Chapter 1, Developing with Flex and Rails, we talk about how to set up your environment. Then in Chapter 2, Passing Data with XML, and Chapter 3, Flex with RESTful Services, we'll show you how to integrate Flex and Rails using XML, both with a regular and with a RESTful Rails service. Chapter 4, Using Fluint to Test a Flex with Rails Application, addresses testing. Chapter 5, Passing Data with AMF, discusses how to integrate Flex with RubyAMF, which uses the Flash-native AMF protocol. Sooner or later you're going to want to learn how to debug your applications on the front- and back-ends to learn about what's going on or going wrong with them, so Chapter 6, Debugging, discusses debugging in both environments. One of the great features of Flex is that it's easy to start making very powerful data visualization features available in your application, so Chapter 7, Data Visualization, introduces several pieces of that topic. Chapter 8, Flex MVC Frameworks, talks a bit about a common topic in the Flex community--which frameworks to choose--and discusses two popular ones. Chapter 9, Performance and Optimization, finishes the main section of the book with a discussion of how to get to the bottom of performance problems in both Flex and Rails and some tips about optimizing your applications. Part II, Cookbook Recipes, was a lot of fun to bring to you. It's in the form of a cookbook, which contains many "recipes" or short discussions and how-to's about topics that you'll have questions about at some point. In Chapters 10 through 22, we cover everything from working with common source control systems and authenticating to pushing data and deploying Flex and Rails applications. Chapter 10: Source Control Flex and Rails Projects Chapter 11: Building Flex with Rake Chapter 12: Deploying Flex and Rails Applications Chapter 13: Read the Source! Chapter 14: Using Observers to Clean up Code Chapter 15: Authenticating Chapter 16: Reusing Commands with Prana Sequences Chapter 17: Hierarchical Data with RubyAMF Chapter 18: Advanced Data Grid and Awesome Nested Set Chapter 19: Runtime Flex Configuration with Prana Chapter 20: Server Push with Juggernaut Chapter 21: Communicating between Flex and JavaScript Chapter 22: File Upload Let's Get Started Now that you've decided to take the first steps to putting Flex on Rails, let's take a look at what you'll need to get your development environment in shape. Start with Chapter 1, Developing with Flex and Rails, to make sure you have all the pieces in place. (c) Copyright Pearson Education. All rights reserved. Excerpted from Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2 by Derek Wischusen, Tony Hillerson, Daniel Wanja All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Table of Contents

Forewordp. xv
Prefacep. xvii
Acknowledgments from Tony Hillersonp. xxi
Acknowledgments from Daniel Wanjap. xxii
About the Authorsp. xxiv
Part I Flex and Rails Essentials
Chapter 1 Developing with Flex and Railsp. 3
Installation: What You Need to Get Runningp. 3
The Structure of a Flex and Rails Applicationp. 6
The Example Codep. 9
Compiling MXMLp. 9
Running the Rails Serverp. 9
Summaryp. 9
Chapter 2 Passing Data with XMLp. 11
XML in Railsp. 11
XML in Flexp. 14
Getting XML to Flexp. 17
Sending XML to Railsp. 19
Mapping Data Typesp. 21
Error Handlingp. 25
Summaryp. 28
Chapter 3 Flex with RESTful Servicesp. 29
Creating the Stock Portfolio Rails Applicationp. 29
Accessing Our RESTful Application with Flexp. 39
Summaryp. 48
Chapter 4 Using Fluint to Test a Flex with Rails Applicationp. 49
Using Fluint to Write Your Flex Unit Testsp. 50
The Basics of Testing a Flex Applicationp. 51
Testing a Cairngorm-Based Applicationp. 59
Using Fixturesp. 79
Summaryp. 83
Chapter 5 Passing Data with AMFp. 85
What Is AMF?p. 85
Benefits of AMFp. 86
RubyAMFp. 87
A Simple RubyAMF Examplep. 95
A RESTful RubyAMF Integrationp. 101
Summaryp. 103
Chapter 6 Debuggingp. 105
Loggingp. 106
Debuggersp. 110
Command Line Debuggersp. 117
Debugging Communicationp. 127
Summaryp. 129
Chapter 7 Data Visualizationp. 131
Online Analytical Processing (OLAP)p. 133
Advanced DataGridp. 144
Chartingp. 147
Summaryp. 152
Chapter 8 Flex MVC Frameworksp. 153
What Do We Mean by a Framework?p. 153
Roll Your Ownp. 154
Cairngorm at a High Levelp. 154
PureMVC at a High Levelp. 159
Stuffp. 163
Summaryp. 182
Chapter 9 Performance and Optimizationp. 185
Flex Performancep. 185
Rails Performancep. 206
Summaryp. 211
Part II Cookbook Recipes
Chapter 10 Source Control Flex and Rails Projectsp. 215
Goalp. 215
Solutionp. 215
Ignoring Files in Subversionp. 215
Gitp. 217
Discussionp. 218
Summaryp. 219
Chapter 11 Building Flex with Rakep. 221
Goalp. 221
Solutionp. 221
Rake Is Your Friendp. 221
The Rakefilep. 222
Summaryp. 225
Chapter 12 Deploying Flex and Rails Applicationsp. 227
Goalp. 227
Solutionp. 227
Capistranop. 227
Deploying with Capistranop. 228
Summaryp. 232
Chapter 13 Read the Source!p. 233
Goalp. 233
Solutionp. 233
The Beauty of Open Sourcep. 233
The Rails Sourcep. 235
Flex Sourcep. 238
Generated Flex Sourcep. 240
Summaryp. 243
Chapter 14 Using Observers to Clean Up Codep. 245
Goalp. 245
Solutionp. 245
BindingUtils and ChangeWatchers in Flexp. 245
Taking Action on ActiveRecord Lifecycle Eventsp. 248
Summaryp. 250
Chapter 15 Authenticatingp. 251
Goalp. 251
Solutionp. 251
Authenticating Usersp. 251
Installing restful_authenticationp. 251
Summaryp. 257
Chapter 16 Reusing Commands with Prana Sequencesp. 259
Goalp. 259
Solutionp. 259
Sequencesp. 259
Prana's EventSequencep. 261
Summaryp. 265
Chapter 17 Hierarchical Data with RubyAMFp. 267
Goalp. 267
Solutionp. 267
Nested Setsp. 267
Summaryp. 273
Chapter

p. 18

Advanced Data Grid and Awesome Nested Setp. 275
Goalp. 275
Solutionp. 275
Overviewp. 275
Create the Rails Application and Databasep. 275
Creating a Script to Load the Datap. 276
Flex Applicationp. 279
Adding CRUDp. 282
Summaryp. 287
Chapter 19 Runtime Flex Configuration with Pranap. 289
Goalp. 289
Solutionp. 289
IoC, Eh?p. 289
Summaryp. 293
Chapter 20 Server Push with Juggernautp. 295
Goalp. 295
Solutionp. 295
Push Technologyp. 295
Juggernautp. 295
Creating the Rails Messaging Applicationp. 297
Creating the Flex Messaging Client Applicationp. 299
Summaryp. 301
Chapter 21 Communicating between Flex and JavaScriptp. 303
Goalp. 303
Solutionp. 303
Communication between Flex and JavaScriptp. 303
Securityp. 303
Building the Samplesp. 304
ExternalInterfacep. 304
SWFObject and Prototypep. 305
ExternalInterface in Actionp. 305
Flex-Ajax Bridge in Actionp. 309
Summaryp. 311
Chapter 22 File Uploadp. 313
Goalp. 313
Solutionp. 313
File Uploadp. 313
Creating the Rails Application and Installing attachment_fup. 315
Using Flex's FileReference Class to Upload
One or Several Filesp. 316
Using Flex URLLoader Class to Upload a PNG Filep. 318
Summaryp. 320
Indexp. 321
Go to:Top of Page