Friday, January 30, 2009

Adobe Flex Introduction

Adobe Flex is a cross platform rich internet application technology based on adobe flash platform. Flex technology released on March 2004, Flex 1.0.
in last of 2008 Abobe released the latest version of flex,- Flex 3.2.

Flex is a cross-platform development framework for creating Rich Internet Applications (RIAs), a component based tool that can use to develop apps that run using the Flash Player or Adobe Air. Flex is almost same as AJAX, JavaFX, Silverlight ( not exactly).flex can support data handling and GUI.

The flex source files are in the form of mxml and actionscript(as) file.it also support
cascading stye sheet(css).Flex offers both Remote Procedure Call (RPC) asynchronous communication and real-time communication features.

Example code

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Label x="10" y="10" text="Output" id="output"/>

<mx:Button x="10" y="36" label="Click Me" click="{output.text = 'Hello World'}"/>

</mx:Application>



The Flex framework proposes three RPC classes for communicating with the application server


1.HTTPServices

The HTTPService class makes HTTP(S) requests (mostly GET or POST) which may transport various content types, from simple URLencoded variables to more complex data like XML. Basically, this is the choice for Representational State Transfer (REST) web services architecture. Most of the time, an HTTPService object is used to communicate with a simple script or page like a JSP page, an ASP page or a PHP script. Obviously, the value of the HTTPService url property is the URL of this page.

The transported data is sent and received as plain text, meaning that you'll have to map the received data to the corresponding ActionScript data type on the Flex side, and to the corresponding server-side technology data type on the server side. Therefore, it may be a good idea to use a special data exchange format like JSON.

2.WebServices

The WebService class sends and receives SOAP messages over HTTP. Naturally, this is what you'll use to communicate with SOAP WebServices. To connect to this WebService and call its operations (i.e. its methods), you'll have to hook this object to the WebService's Web Service Definition Language (WSDL) by setting its URI as the wsdl property value.
All ActionScript primitive types and some built-in ActionScript complex types are automatically mapped from and to SOAP/XMLschema data. This process is handled on the Flex side, by the WebService class. This is quite an improvement over HTTPService-based communications where you have to do that job by yourself, or use third party libraries.


3.RemoteObjects

The RemoteObject class is responsible for sending and receiving ActionScript Message Format (AMF) data. This technique is also called Remoting.

AMF is not a transfer protocol: it is binary ActionScript. AMF3 is the binary format for AS3, whereas AMF0 was the binary format for AS1 and AS2

No comments:

Post a Comment