Sunday, 7 December 2008

Remote DataService in Flex

Flash Player is capable of making RPCs to many types of data services. For example,Flash Player can make requests to any web resource using HTTP, which means it canmake requests to many primitive data services such as a static or a dynamic XMLdocument, or the MapQuest example mentioned previously. That also means it canmake requests to web services. Moreover, the Flex class library simplifies requests to most data services.
In addition to the types of data services previously mentioned, Flex applications can also make calls to methods of classes on the server, using a technology called Flash Remoting. Flash Remoting uses the AMF binary messaging format, which is supported natively by Flash Player. AMF has all the benefits of SOAP, but since it is binary, the bandwidth overhead is greatly reduced. And since AMF is natively supported by Flash Player, no special coding is necessary to use Flash Remoting data services from the client tier. However, for a Flash Remoting data service to be available to the client tier, it must be made accessible via a piece of software that resides on the server, and can read and write AMF packets and delegate the requests to the correct services. Flex Data Services provides an implementation of Flash Remoting that integrates easily with components in the Flex framework. That means that if you use Flex Data Services, you can quickly configure applications to utilize Flash Remoting without writing ActionScript. However, you’re not locked into using Flex Data Services in order to use Flash Remoting. There are many Flash Remoting server products, including open source options such as OpenAMF (http://www.openamf.org) and AMFPHP (http://www.amfphp.org).

No comments: