Archive for the ‘RIA Training Services’ Category

Learn Flex from Champions for Free !!

September 6, 2010

Adobe Flex is picking pace and is reaching a more organic level viz. the student community in India, and rightly so. If the next generation of engineers come equipped with knowledge for technologies like Flex, ColdFusion, Silverlight, Scala etc it will give Indian IT a new high.

There are lot of initiatives that are going on currently to spread Flex around. Like Adobe’s Flex@Campus which gives educational organization across India to leverage a free 1 day training on Adobe Flex. The flex community in India has extended its support to it. Because it is a hands on program, it gives you a head start into the technology allowing you to create a base on which you can build up.

Then there is RIA Connect. It is a Tekno Point initiative that is not restricted to Flex alone. It could me on any Adobe Product like Photoshop, Illustrator, Flash Professional, Flex, ColdFusion. It is a 1 day program for corporates, educational institutes or any other organization allowing them to understand the underlying abilities of the Technology and a follow up hands on session to get them started. The contents of this one day workshop are modified keeping the audience in mind. For Designers/ Devs there is more of  hands on and for business heads, architects there is more breadth in which the workshop topics are covered.

Don’t wait to get started. Go to the links and fill the forms to take your first step, as common sense says “To reach anywhere, you have to start from the beginning and go through the middle”

Using the Spinner control in flex 4

May 12, 2010

The Spinner control is an alternate to NumericStepper’s in Flex 4. The advantage is while it works with ranges, it is not hard bound to a numeric input. You can choose to step through a collection and display images or any other content.

Spinner Control Sample App

Spinner Control Example in Flex 4

Below is some code which associates text from a collection to the numeric stepper as seen in image above.

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"  width="350" height="150">

<fx:Script>
<![CDATA[

import mx.collections.ArrayCollection;
[Bindable] private var dataColl:ArrayCollection = new ArrayCollection
(["Flex","Flash","Catalyst","Slider","FlashLite","DeviceCentral"])
]]>
</fx:Script>

<s:HGroup x="50" y="58" verticalAlign="middle" >
<s:RichText textAlign="right" width="200" text="{dataColl.getItemAt(spinner.value)}"/>
<s:Spinner id="spinner" minimum="0" maximum="{dataColl.length - 1}"/>
</s:HGroup>


<s:Label x="78" y="38" text="Click on the arrows to change values"/>
</s:Application>

LCDS – how it all works

May 11, 2010

We have been consulting/training on LCDS for some time now there is a common need for an overview from a working perspective which helps decide whether to go with it or not.

This article is one such effort to shed some light on how it all works

LCDS is a Java web project which enables Flex/AIR clients to invoke Java methods, concurrently update clients, and supports proxy. It mainly contains 2 things

  1. A webserver
  2. A socket – server

So why is LCDS required?
One of the reasons for which it (and BlazeDS) are widely used is: Clients like Flex/Flash/AIR can publish data in an AMF format. AMF is a binary protocol and hence the footprint of data is lighter so it travels much faster over the network.

Java does not have native support to understand AMF (which is an Open Spec. protocol). LCDS contains a suite of Java classes which deserializes AMF data and passes it to Java as a Java data type.

It primarily has 4 types of services:

  1. (HTTP)Proxy Service
  2. Remoting Service
  3. Messaging Service
  4. Data Management Service

All these services are supported by protocols. A protocol defines how data is passed to the Java layer.

3 key protocols supported are are:

  1. HTTP
  2. AMF
  3. RTMP

You can also use variants like AMFX (non – binary XML version of AMF). These protocols are used to pass message objects via a Channel. A message object is the entity that Flex want’s to send across

There are  various channels that support these protocols

AMF, Secure AMF, HTTP, RTMP, Secure RTMP, NIO – AMF, NIO RTMP and others.

You can select a channel depending on the type of communication you want to establish.

Each of these Channels are associated with end points. So a message objects travels over a channel and hits an end point on the LCDS server. Making an endpoint unique for a channel

There are 2 types on end-points:

  1. Serverlet based end point (typically the MessageBroker Servlet) – Uses a webserver
  2. Socket based end point – these are more scalable (NIO/RTMP) – Uses a socket server

Once a message has hit the end point, It starts its journey inside the LCDS server. Here it goes through a series of layers starting from

  • The MessageBroker -Here is where authentication takes place, and the service is identified for the message
  • The Service is identified and one of these HTTPProxyService/RemotingService/DataService/MessagingService is invoked Depending on the destination of the message.
  • This destination is set by Flex in the message when it serializes it. The association between Flex and your Java Service is mapped using a destination.

Flex - LCDS Destination - Java
Flex – LCDS Destination – Java

  • Finally the Adapter kicks in. This is the entity responsible of invoking the Java class and passing data. This Adapter depends on the service that you use
  • Typically for a DataService (read Data Management Service) there is another layer of Assembler which could be either a standard from LCDS or custom created depending on the back-end or the data tier.

LCDS has in built assemblers for Hibernate and others.

The entire flow can be summarized as:

Flex LCDS Communication

Flex LCDS Communication

That, in a nutshell, speaks about LCDS. Most things also apply for BlazeDS. If you have queries/suggestions/comments. Please feel free to put them in the comments section.

Y


%d bloggers like this: