O'Reilly logo

Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2 by Daniel Wanja, Tony Hillerson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14 Using Observers to Clean Up Code

Goal

You’d like to decrease the dependency certain parts of your application have on other parts of it to keep things flexible and clean, especially when you need to take action in one part of your application when something in another part changes.

Solution

In Flex, use binding tags, BindingUtils and ChangeWatchers, to be notified when state changes occur in another part of the application.

In Rails, use the ActiveRecord lifecycle methods and observers to take action when certain events take place on your models.

BindingUtils and ChangeWatchers in Flex

As you’ve gone through this book and seen how powerful and useful Flex’s binding syntax is for cleaning up your code, you may have ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required