Thursday, January 08, 2009

BlazeDS quick notes

=== What is BlazeDS? ===

+ Java remoting and Messaging Technology.

+ Enables developers to connect to back-end distributed data and push data in real-time to Adobe Flex and Adobe AIR applications

+ Open Source

+ From SOAP to AMF (Action Message Format)

+ 10 times faster than XML based protocols, how?

+ Previously known as Adobe LCDS

=== Remoting (RPC) ===

+ Instead of Contacting services, RPC components contact 'Destinations'

+ Destination: Manageable Service Endpoints

+ Managed using XML based configuration file

+ 'Remote Object' not possible without BlazeDS
( Adobe Flash Player blocks request to any external hosts, solution? )

+ crossdomain.xml required ( For apps that are not using BlazeDS )

+ XML file that indicates:
- Data and documents are available to SWF files served from certain/all domains
- Must be in 'web root' of the server

=== AMF (10 times faster!) ===

+ Compact binary format for data serialization/ deserialization and remote method invocation.

+ Object encoding controls how objects are represented in Action Message Format (AMF).

+ Representation that can be transferred over HTTP/HTTPS.

+ As data size increases the performance benefits of using BlazeDS increase exponentially.

+ AMF improves performance by
- Dramatically compressing the size of data transferred.
- Parsing binary data into objects in memory far more efficiently than parsing XML data.

=== Quick Brief ===

+ Message Agents:
- Message Producers & Consumers
- Exchange messages through a common destination

+ Channel and endpoints
- Formats, Translates messages into network-specific form.
- Delivers to the endpoint (on the server)
- Server-Side Channel Unmarshals messages
- Configuration settings ( XML files) at runtime

+ Message Broker
- Routes messages to the appropriate service based on its type

+ Channel Types

=== Channel Configuration ===

+ Configure channels using services-config.xml

+ AMF protocol use an optimization technique

+ Assign channel at runtime( AS Code) by creating a ChannelSet object, and adding a channel to it.

var cs:ChannelSet = new ChannelSet();
var channel:Channel = new AMFChannel(“name”, endpoint)
Remoteobject.channelSet = cs;

=== Remote Object components ===

+ Access methods of server-side java objects.

+ No need to specify 0bjects as operations in web services

+ Use RemoteObject component in MXML/AS

+ Server - Proxied access to an RPC service

+ Communication happens over a 'destination'

+ Configured in the remoting-config.xml
- RPC method or URL, channel, adapter

+ Asynchronous communication
- AsyncToken object

+ Http Service and web service use proxy-service.xml for configuration.
- Limit access to specific URL
- Provide Security

=== BlazeDS with Tomcat ===
+ Unzip the blazeds-turnkey file on to your C: drive
(Blazeds comes with Tomcat default.)

+ Create a new application: C:\blazeds\tomcat\webapps

+ Copy & paste the META-INF, WEB-INF folder from the samples (zip) file.

+ Store all your java class files in WEB-INF/classes folder

+ Configure remoting-config.xml under WEB-INF/flex/ for all your remoting related details (destinations) . Create a and a specify a

+ Configure messaging-config.xml under WEB-INF/flex for all your messaging (real-time) by adding your destination

+ For all other service related details use the proxy-config.xml

+ Give references of all these xml files in services-config.xml (done by default)

+ Run your application http://:/


No comments: