|
|
Adobe Introduces FABridge - an Flex AJAX Bridge
|
04/18/2006, By Ajax Impact News
|
Adobe Labs has recently introduced FABridge, an JavaScript library that enables the developers to easily integrate the Flex applications with Ajax or DHTML code running in the browser.
The Flex-Ajax Bridge (FABridge) is a small, unobtrusive library of code that you can insert into a Flex application, a Flex component, or even an empty SWF file to expose it to scripting in the browser. It is being released to the community under an open source license.
To humbly borrow a page from the Ruby on Rails community, FABridge is built with the “don’t repeat yourself” principle in mind. Rather than having to define new, simplified APIs to expose a graph of ActionScript objects to JavaScript, with FABridge you can make your ActionScript classes available to JavaScript without any additional coding. Once you’ve inserted the library, pretty much anything you can do using ActionScript, you can do using JavaScript.
Flash Player has the ability natively, through the External API (the ExternalInterface class), to call JavaScript from ActionScript and vice versa.
Some of limitations of ExternalInterface are:
The ExternalInterface class requires you, the developer, to write a library of extra code in both ActionScript and JavaScript, to expose the functionality of your Flex application to JavaScript, and vice versa.
The ExternalInterface class also limits what you can pass across the gap – primitive types, arrays, and simple objects are legal, but user-defined classes, with associated properties and methods, are off-limits. You’re limited in what you can do.
The ExternalInterface class enables you to define an interface so your JavaScript can call your ActionScript – FABridge essentially lets you write JavaScript instead of ActionScript.
You can use the FABridge library to automatically expose your Flex application to Ajax-based HTML applications. Using the bridge, you can easily embed rich Flex components in your applications, integrating them tightly with the rest of the page content. Once a Flex application is enabled through the bridge, JavaScript developers have access to all of the functionality it provides.
Use the Flex-Ajax Bridge in following situations:
1. Want to use a rich Flex component in an Ajax application but don’t want to write a lot of Flex code. If you wrap the component in a bridge-enabled stub application, you can script it entirely from JavaScript – including using eval()’d JavaScript generated remotely by the server.
2. Only have one or two people on your team who know Flex. While I would strongly encourage everyone to grab a copy of Flex and try it out (you’ll love it, I promise!), the FABridge library allows everyone on your team to use the work produced by one or two Flex specialists.
3. Are building an integrated RIA with both Flex and Ajax portions. While you could build the integration yourself using ExternalInterface, you might find it faster to start with FABridge as a head start.
Download the FABridge
Explore FABridge now....
|
Rate this Ajax News
Rating: 10.0 out of 1 vote cast
| |
|
|
| |
|
|
|
|
|
|
|
|