Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

BlazeDS and LiveCycle Data Services samples galore in Tour de Flex

by Greg Wilson

Greg Wilson

Modified

6 July 2009

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
BlazeDS Flex

Requirements

User level

Beginning

Note: Content on this page first appeared in the author's blog on June 24, 2009.

During the past several weeks, we have been adding new samples in the Flex Data Access category in Tour de Flex. All of the samples were created by either Christophe Coenraets or Holly Schinsky. Below is a brief overview of each.

Many of the samples described below utilize BlazeDS or LiveCycle DS. If you are unfamiliar with these products, I recommend Holly's Quick Start.

Basic Stuff

HTTPService – Basic Example
This one is fairly obvious – it demonstrates how to use the HTTPService to consume XML and other responses via HTTP or HTTPS. This is the most basic type of data access in Flex.

HTTPService – HTTPService Events
This sample builds on the previous sample and demonstrates how to handle result and fault events from HTTPService. Note that HTTPService calls are asynchronous so understanding these events is key.

HTTPService – E4X
This sample also uses HTTPService but specifies that the result format will be E4X

HTTPService – Using the Proxy Service (BlazeDS and LCDS)
All of the prior samples used the out-of-the-box HTTPService component to directly connect to the data source. Sometimes it is not practical to connect directly to the data source due to it being on a different domain (and lacking a crossdomain.xml entry) so a proxy service is needed. BlazeDS/LCDS can provide this proxy service with some simple configuration as described in this Tour de Flex sample.

WebService – Basic Example
Using the WebService tag, you can invoke SOAP-based web services. Objects returned by a web service are automatically de-serialized into ActionScript objects. Going the other way, ActionScript objects are passed as arguments to a web service operation and are serialized according to the WSDL description.

WebService – Using the Proxy Service (BlazeDS or LCDS)
Similar to our HTTPService Proxy section above, it is sometimes not practical or possible to connect directly to the service. Once again, the BlazeDS/LCDS proxy service provides a simple solution.

Blazingly fast remoting

RemoteObject – Basic Java Remoting (BlazeDS or LCDS)
If you are connecting to a Java backend, it is possible to directly invoke methods of Java objects using RemoteObject. In addition to the obvious benefits of being able to call Java methods directly, you also get the benefits of AMF that is used to pass data back and forth. AMF is a compressed, binary format that is dramatically faster than verbose XML or other text formats. Lee Brimelow wrote a great blog post on AMF here. This Tour de Flex sample does a simple call to Flex.samples.product.ProductService, a simple Java class, a displays the data in a datagrid.

James Ward has created a great application that benchmarks AMF and compares it to several other data loading techniques.

RemoteObject – Basic Java Remoting 2 (BlazeDS or LCDS)
This sample is similar to the previous sample but also demonstrates handling result and fault events from the remote call (RemoteObject calls are asynchronous)

http://gregorywilson.smugmug.com/photos/566219731_cbsTb-S.jpg

RemoteObject – RemoteObject Events (BlazeDS or LCDS)
Another good example of handling RemoteObject events.

RemoteObject – Strongly Typed Object (BlazeDS or LCDS)
This RemoteObject sample demonstrates how an ActionScript object is mapped to a remote Java object. The readme contains links to the backend Java source so you can see how each data attribute is mapped.

Almost magical – Data Management

Basic Data Management (LCDS)
LiveCycle Data Services ES Data Management Service feature provides an efficient approach to synchronizing data across multiple views and between multiple clients. With LCDS, you don't have to keep track of changes made to the data, nor do you have to invoke remote services to notify the backend of the changes (create, update, delete) made on the client side. To demonstrate this, the sample prompts you to open a link in two different web browsers (the browsers can even be on different computers).

http://tourdeflex.adobe.com/remotesamples/DataAccess/datamanagement_simple_update/screenshot.jpg

Each browser will display a data grid with a few rows of data. As you update the data in one browser, you'll see the changes immediately reflected in the other browser, keep the views in sync. This type of functionality typically requires rather complex code, but as you can see in the Tour de Flex sample, it's easy to implement using LiveCycle Data Services.

Conflict Management (LCDS)
This sample is similar to the previous sample in that you open a link in two browsers and each of the views stays in sync but this one also adds code to handle conflicts between the two users. Change data in a field on browser #1 AND in browser #2. When you save the data in one of the browsers, the other one will notify you of a conflict. This is another example of where LCDS can save a LOT of coding.

http://tourdeflex.adobe.com/remotesamples/DataAccess/datamanagement_update/screenshot.jpg

Managing Associations and Lazy Loading (LCDS)
This sample demonstrates how LCDS can load data on an as-needed basis (lazy). In this code, there are multiple many-to-one data relationships defined so that LCDS loads the associated data on demand.

Data Paging (LCDS)
This sample demonstrates automatic paging of large data sets. Rather than loading the entire query result set, the data is loaded on demand while keeping up with the latest changes to the data. Data paging speeds application response times and minimizes memory requirements client-side. The sample displays a simple datagrid that loads 100 rows at a time. As you scroll through the data, you will see brief delays as the next 100 rows are loaded. This is yet another example of LCDS saving the developer from having to write a lot of complex code.

Backend Persistence Options (LCDS)
At the end of the Data Management category is a subcategory demonstrating 3 different ways to manage data persistence used by the data management features. There is a sample that uses SQL, a sample that uses Hibernate and a sample that demonstrates how to build a more complex custom assembler.

Real-time publish/subscribe messaging

Chat (BlazeDS or LCDS)
This sample demonstrates how to build a simple chat client that utilizes the publish/subscribe messaging provided by BlazeDS or LCDS.

Collaboration (BlazeDS or LCDS)
This sample uses publish / subscribe messaging to build a simple collaborative application. The sample prompts you to open a link in two or more browsers. When you click the button to switch the graph from company one to company two, the other clients will also switch.

http://tourdeflex.adobe.com/remotesamples/DataAccess/messaging_collaboration/screenshot.jpg

Real-time dashboard (BlazeDS or LCDS)
This sample shows how to subscribe to a real-time data feed produced by the Tour de Flex server. The data is real and is produced by the Tour de Flex server. Each row in the data grid is produced when a sample is viewed in Tour de Flex. This is the foundation for the much more graphical dashboard.

http://gregorywilson.smugmug.com/photos/545702434_sSj28-S.gif

More samples will be added to the Flex Data Access category very soon to demonstrate how to connect Flex applications to ColdFusion, .NET, PHP and other backends. Stay tuned!

UPDATE: .NET and PHP samples added by MidnightCoders.

Tutorials & Samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex User Forum

More
07/25/2011 Flash Player Debug Issues - Safari 5.1 & Chrome 13
04/22/2012 Loader png - wrong color values in BitmapData
04/22/2012 HTTPService and crossdomain.xml doesn't work as expected
04/23/2012 Memory related crashes in Flex application

Flex Cookbook

More
04/06/2012 How to detect screen resize with a SkinnableComponent
02/29/2012 Embed Stage3D content inside Flex application components
02/15/2012 Custom WorkFlow Component
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement