Grey Line

Flex RSLs are notoriously naive in regards to dynamic object instantiation. Consider the following code snippet when the actual class descends Panel or it is a remoting DTO with the [RemoteClass] annotation:

var className:String = "some.flex.class";
var clazz : Class = loaderInfo.applicationDomain.getDefinition(className) as Class;
var instance: Object = new clazz();

In either case, well being of the class is based on mixins – decorator classes generated by Flex compiler. Mixins carry obligatory init(o:Object/*systemManager or moduleFactory*/) method and get called to decorate startup class of the application (SystemManager) or the module (ModuleFactory). For instance, a class with [RemoteClass("foo.Bar")] annotation contributes a similar looking fragment to the mixin class _YourApplicationName_FlexInit:

  try {
      if (flash.net.getClassByAlias("foo.Bar") == null){
          flash.net.registerClassAlias("foo.Bar", flex.class.with.RemoteClassAnnotation);}
  } catch (e:Error) {
          flash.net.registerClassAlias("foo.Bar", flex.class.with.RemoteClassAnnotation); }

Similarly, a class that descends from a Panel depends on mixin [_YourApplicationName]_Styles to carry the following:

        .  .  .
        // spark.components.Panel
        selector = new CSSSelector("spark.components.Panel", conditions, selector);
        mergedStyle = styleManager.getMergedStyleDeclaration("spark.components.Panel");
        style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
        . . .

Now, here is the problem. If you hide your class behind getDefinition() Flex compiler does not contribute to either _FlexInit or _Styles mixins. In other words, your RSL may contain 100 classes, all of them will be loaded, but they will be lacking proper initialization if you did not explicitly reference them in the application.


Problem Illustration

Let’s illustrate. On the left is the application that on button click … fails to dynamically instantiate a custom panel from standard Flex RSL. On the right we show working application AFTER the solution has been applied (Patience, reader, patience!)
Sample application with problem before and after treatment
Here is the application code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" >	
   <s:layout><s:VerticalLayout  horizontalAlign="center" /></s:layout>	
   <s:Button  label="CreatePanel" click="createComponent('com.farata.samples.CustomPanel')"/>
	<fx:Script><![CDATA[
			import mx.core.IVisualElement;
			private var visualElement:IVisualElement;
			//import spark.components.Panel;Panel; // That would be too simple :) 
			private function createComponent(componentName:String) : void {		
				var clazz : Class = loaderInfo.applicationDomain.getDefinition(componentName) as Class;
				visualElement = IVisualElement(new clazz() );
				addElement(visualElement);
			}			
	]]></fx:Script>
</s:Application>


The very custom panel is hosted by a separate Flex Library Project – ComponentLibrary:

<?xml version="1.0" encoding="utf-8"?>
<s:Panel  xmlns:fx="http://ns.adobe.com/mxml/2009" 
		   xmlns:s="library://ns.adobe.com/flex/spark"  
	title="'Custom' Panel #{instanceNumber}" 
	width="300" height="150"  
	creationComplete="instanceNumber=++count;trace('Panel' + instanceNumber);"
>
	<fx:Script>
		public static var count:int;
       [Bindable] private var instanceNumber:int;
    </fx:Script>
</s:Panel>

Make sure the link type of the ComponentLibrary is set to “RSL”. Run the application, click on the Button – you won’t see any panels. Better yet, Debug (instead of Run) and you will notice console trace statements of the panels actually being created. However, custom panel is not shown, because _Styles mixin lacks section for ancestor – Spark Panel.


Solution

So what is the solution? Obviously, the Adobe RSL SWF has to be replaced by something else. By default, ComponentLibrary.swf get extracted from ComponentLibrary.swc on every build of the application. But, if we turn off the “AutoExtract” checkbox, we are free to replace it with the SWF of our own making. Which one? A sub-application SWF. Instead of a headless, single framed RSL SWF, we will use double framed application SWF adding a descendant of the mx.core.SimpleApplication as a head class. Within such head class we can statically reference all library classes. As a result, compiler will generate required mixins within the “library” SWF. That is why in Farata we coined the term self-initialized library, meaning that classes in our library do not need external initialization by the Flex compiler:

<?xml version="1.0" encoding="utf-8"?>
package {
  import mx.core.SimpleApplication;
  public class LibraryHead extends SimpleApplication {
 
        // List all library classes here, so Flex compiler will take care of them
        import  com.farata.samples.CustomPanel;com.farata.samples.CustomPanel; 
 
	public function LibraryHead() {
		// Custom library initialization code may go here
		trace("Self-initialized library has been loaded");
	}
}
}

As a matter of fact, the last drop required to force Flex compiler into mixin generation is to use a MXML extension of the LibraryHead as the compilation target:

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<LibraryHead 
	xmlns="*"
	xmlns:fx="http://ns.adobe.com/mxml/2009"  />

Importantly, we use Ant scripts to build self-initialized libraries, since out of the box Flex library project is not positioned to produce SWFs:

<project name="Library-Application" default="compile" basedir=".">
	<target name="compile">
		<property name="sdkdir"
			value="/Applications/Adobe Flash Builder 4 Plug-in/sdks/4.0.0" />
		<property name="swclibs" value="${sdkdir}/frameworks/libs" />
		<property name="application.name" value="LibraryMXMLHead" />
		<property name="library.name" value="ComponentLibrary" />
		<exec executable="${sdkdir}/bin/mxmlc" dir="${basedir}">
			<arg line="-external-library-path+='${swclibs}/player/10.0/playerglobal.swc'" />
			<arg line="-external-library-path+='${swclibs}/textlayout.swc'" />	
			<arg line="-external-library-path+='${swclibs}/osmf.swc'" />	
			<arg line="-external-library-path+='${swclibs}/flash-integration.swc'" />	
			<arg line="-external-library-path+='${swclibs}/spark.swc'" />	
			<arg line="-external-library-path+='${swclibs}/sparkskins.swc'" />	
			<arg line="-external-library-path+='${swclibs}/rpc.swc'" />	
			<arg line="-external-library-path+='${swclibs}/datavisualization.swc'" />	
			<arg line="-external-library-path+='${swclibs}/flex.swc'" />	
			<arg line="-external-library-path+='${swclibs}/framework.swc'" />	
			<arg line="-external-library-path+='${swclibs}/utilities.swc'" />	
			<arg line="-keep-generated-actionscript=true " />
			<arg line="src/${application.name}.mxml" />
			<arg line="-output bin/${library.name}.swf" />
		</exec>
	</target>
</project>

Wait! There is more. In Flex 3 making and using self-initialized library would be enough. In Flex 4, however, we have to replace single line of code that applies the mixins in the mx.core.FlexModuleFactory, ancestor of the SimpleApplication. In place of


           c["init"](this);

we should put more sophisticated code that instead of decorating the factory class of the loaded library decorates the factory class of the entire application, i.e. SystemManager:

var mixinTarget:Object;
	 if (this is FlexApplicationBootstrap) //aka self initialized library
		mixinTarget = SystemManagerGlobals.topLevelSystemManagers[
                     SystemManagerGlobals.topLevelSystemManagers.length-1
                ];
	 else 
                mixinTarget = this; 
	 c["init"](mixinTarget);

Add this class to the application sources and … it won’t be considered by the SWF. For one thing, if you did not explicitly reference a variable of this class (or use -includes compiler switch) it will not make into SWF at all. Even if you did, however, remember that Flex SWF links the minimal number of classes to the first frame (FlexModuleFactory is NOT among them) and all the rest – to the second. In between (actually – under the control of the first frame’s code) Flex dynamically loads classes from RSLs, starting from signed RSLs and ending with your custom ones. By the time ComponentLibrary.swf get loaded, class definition of the mx.core.FlexModuleFactory will already be grabbed from “earlier” framework.swc. That’s a known challenge of Flex “monkey patching”. The simplest way to overcome it is to overlap application sources with one of the classes that Flex must put in the first frame. It can be custom preloader or mx.core.SystemManager itself, however, in this context we prefer mx.core.RSLListLoader. Simply, add import mx.core.FlexModuleLoader;mx.core.FlexModuleLoader; anywhere in the modified mx.core.RSLListLoader and add it to the source path of your main application along with the modified FlexModuleFactory. Again, we use it to our advantage that all dependancies of SystemManager, including RSLListLoader get linked to the first frame:

    import mx.core.FlexModuleFactory; mx.core.FlexModuleFactory; // WE ADDED THIS
    public function RSLListLoader(rslList:Array) 
    {
    	super();
        this.rslList = rslList;
    }

Believe it or not, that’s it.

Here is the summary of the steps:
1. Turn-off “autoextract” of the SWC
2. Create self-initialized library SWF and place it into bin or bin-debug
3. Add monkey-patched FlexModuleFactory and RSLListLoader into Flex sources
4. Say good-bye to plain old Flex RSLs.

I’d like to use this opportunity and invite Flex developers living in Europe to attend our Advanced Flex Master Class in Brussels, Belgium on March 1 and 2, 2010.

Victor Rasputnis

Comments (2)

 

Grey Line

A month ago I wrote a blog titled “The RoadMap for Adobe LCDS 3”.  I was so naïve suggesting cutting the prices for LCDS licenses!

The inexpensive ($6K per CPU) departmental license is discontinued. LCDS Express edition is gone.

Get ready to pay around $30K per CPU for Enterprise LCDS 3 license.  It’s really sad that Adobe marketing is killing a great product created by Adobe software engineers.

After reading the chain of comments to the blog of Anil Channappa, LCDS and BlazeDS project manager,  it seems that Adobe does everything to ensure that our open source Clear Toolkit with BlazeDS will become even more popular.

Clear Data Builder (the flagship piece of Clear Toolkit) generates both Flex and Java code from POJO or SQL, supports data sync between different users (yep, with ChangeObjects under the hood), does the server side data push over AMF, knows how to deal with master-detail (hierarchical) collections, supports transactions, has smart  DataForm and Validator components.  We also know how to make BlazeDS scale to support many concurrent users.

Almost forgot, we have generators for AS3 classes from their Java peers and a generator of ANT build scripts from your Flex Builder projects.

Do you know the cost of Clear Toolkit per CPU? You got it. It’s zero dollars, euros, rubles and rupees.

At the time of this writing Clear Toolkit doesn’t support Model-Driven development…Read my lips.

If there is a customer who wants to hire us and shell a little bit of cash for R & D, we can add a support of RTMP too (shared copyright only).

Adobe also stopped offering commercial support of BlazeDS. Well, you know where to go for this.

Some companies have short memories. When Flex own by Macromedia, was server-side only and priced at $15K, nobody knew about this product. After the merger in late 2005, Adobe did a really smart move by moving this great tool to the client side with reasonably priced Flex Builder.  Now, it looks like Adobe re-hired those old Macromedia salesmen. Big mistake.Huge.

Yakov Fain
P.S. I’d like to use this opportunity and invite Flex developers living in Europe to attend our Advanced Flex Master Class in Brussels, Belgium on March 1 and 2, 2010. We still have a couple of seats available.

Comments (1)

 

Grey Line

First of all, Flex and BlazeDS are open sourced and free, which is important for many IT shops even those from filthy rich Wall Street companies. Typically, an enterprise IT group has a limited budget, and even though a more advanced LiveCycle Data Services component offers you more options and better scalability than BlazeDS, for most of the applications using BlazeDS installed in any Java Servlet container is a very solid way of building RIA that are a lot more superior to those built on plain HTTP let alone SOAP Web Services.

The main power of BlazeDS is its binary AMF protocol that seamlessly serializes strongly typed data between Flex and Java. Just think of the typical use case described below.

A POJO on the server side gets a bunch of Customer.java records (say, ArrayList) from a data source and needs to display them as a grid in a Web Browser. With a regular HTML/JavaScript Web application you’d need to convert the customers’ data into some kind of text representation (losing the data types information of customer data), then GZip the data, send them to the client, and using JavaScript manipulations convert the data into appropriate data types for further processing.

You don’t need to do any of these while sending the data from Java on the server to Flex on the client. The ArrayList of customers gets serialized/deserialized into an ActionScript ArrayCollectoin of strongly typed data transfer objects defined in the class Customer.as.

HTTP batching and streaming is a combination of few technologies with a close resemblance to how car traffic is controlled on some highways. There are dedicated lanes for high-occupancy vehicles (HOV) that move faster during the rush hours. Such HOV lanes can be compared to the
HTTP channels opened for streaming. For example, you can program network communications in such way that one channel allows only two data pushes per second (a guaranteed QoS), while the other channel will try to push all the data, which may cause network congestion, delays, and queuing.

With AMF, the data gets loaded faster than with nonbatched requests/responses. And it plays nicely with the typical infrastructures that use firewalls as it piggybacks on the existing browser HTTP requests.

However, for critical HTML/JavaScript applications a problem remains: there is no QoS provided by HTTP protocol, which may become a showstopper. For example, think of a financial application that sends real-time price quotes to the users. The server keeps sending messages, regardless of the current throughput of the network, which in case of network congestion will be causing problems with queues overruns or lost packages.

Recently released LCDS 3 has introduced features to support reliable messaging and throttling, while BlazeDS won’t have it. This is when opensourceness of Flex and BlazeDS becomes handy, because it allows you to customize communication protocols to perfectly meet all the needs of your application and squeeze out a lot more performance from BlazeDS than it’s advertised by Adobe.

How do you even start customizing network protocols? Even the idea of doing this sounds scary, right? It won’t be, if you’ll attend our Master Class in Brussells, Belgium in March: http://www.eventbrite.com/event/527934065. We are planning to run a couple of more if these events in the USA too. Let me throw in some technical terms now since not everyone can appreciate the quality of the Belgium beer yet.

If you open the server-side configuration file services-config.xml that comes with BlazeDS, you’ll find declarations of several communication channels there, for example:

<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
 <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>

This is an example of configured AMF communication channel. There are three important notions to understand here.

1. AMF operates using messaging under the hood. When you make an RPC call to a remote Java class (a.k.a. destination). Flash Player sends messages to the server, and you can change the way messages are being formed or processed.

2. On the client side (Flex) the ActionScript class a.k.a. channel can be customized, if need be. In the example above this would be the class mx.messaging.channel.AMFChannel.

3. On the server side, there are two Java classes that can be customized: an endpoint (see above flex.messaging.endpoints.AMFEndpoint) and adapter.

Let’s say, you want to ensure that every message header includes a userID that has been authenticated during the logon process, you can do it by customizing the channel and the endpoint classes. This way you won’t need to pass the user ID with every application-specific RPC call.

Two years ago, one of our financial clients was concerned with potential out-of-sequence messages in a trading workflow. Back than it was the application based on LCDS 2.5, which didn’t offer any support in this area. We’ve customized the channel and adapter to provide this functionality. We’ve also implemented throttling to slow down the message pushes in congestion situations. The same things can be implemented with BlazeDS.

Or let’s take another real-world situation when an extra security is required: the client’s workstation has to be automatically logged off and disconnected, if the server didn’t respond during a specified time interval. To put it simple, we need to implement some kinds of heartbeats. Yes, you can customize the AMF protocol so it’ll process heartbeats between the Flex client and Java server.

Didn’t respond to my heartbeat within 20 second? You’re a dead man! The user get’s logged out of the system.

Need better performance with BlazeDS? Introduce a non-blocking I/O.
How about an idea of a reverse RPC call? I mean what I mean. A Java server calls a specified function on the user’s (Flex) application passing whatever arguments are required by the function.

“You may say, I’m a dreamer. But I’m not the only one”, sang John Lennon.

For some reason, most of the RIA developers are into flashy UI as it’s considered to be uber cool. But don’t underestimate the power of the networking protocols in general and of AMF in BlazeDS in particular. At least I know, where the power of Flex and Java EE application is hidden.

Yakov Fain

Comments (6)

 

Grey Line

In my previous post I pointed to the BlazeDS classes that need to be replaced in order to prevent ActionScript Number.NaN from turning into Long or Integer zeroes on the MessageBroker side. The recommendation boiled down to re-jaring flex-messaging-core.jar or placing the modified classes somewhere earlier in the application server’s classpath. If neither option is allowed, you may configure your endpoint with the custom type marshaller, like the one below:

        <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
            <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" 
            class="flex.messaging.endpoints.AMFEndpoint">
            </endpoint>
            <properties>	
	            <serialization>
            		<type-marshaller>com.farata.messaging.io.CustomTypeMarshaller</type-marshaller>
            	</serialization>
            </properties>	
        </channel-definition>

In BlazeDS 4 you will base your type marshaller on flex.messaging.io.ASTranslator, in BlazeDS 3 they already have one level of extension called Java15TypeMarshaller, so build on top of that one:

package com.farata.messaging.io;
 
import com.farata.messaging.io.amf.translator.decoder.NumberDecoder;
import flex.messaging.io.amf.translator.decoder.DecoderFactory;
 
// For BlazeDS 4 you should extend flex.messaging.io.ASTranslator
public class CustomTypeMarshaller extends
		flex.messaging.io.Java15TypeMarshaller {
 
    private static final NumberDecoder numberDecoder = new NumberDecoder();
 
    public Object convert(Object source, Class desiredClass)
    {
    	if ( DecoderFactory.isNumber(desiredClass)){
    		return numberDecoder.decodeObject(source, desiredClass);
    	}else{
    		return super.convert(source, desiredClass);
    	}
    }
}

This route does not require neither server-level deployment nor modification of the flex-messaging-core.jar.
Please note that in my example I repackaged NumberDecoder as com.farata.messaging.io.amf.translator.decoder.NumberDecoder

I’d like to use this opportunity and invite Flex developers living in Europe to attend our Advanced Flex Master Class in Brussels, Belgium on March 1 and 2, 2010.

Victor Rasputnis

Comments

 

Grey Line

This question we get on almost every new client project: “We’re struggling with handling of null values for numeric data types in Flex/Java projects. Every time there’s an update, we end up replacing the original nulls with zeros when the user didn’t actually change that value.  Have you guys come up with a silver bullet for handling numeric nulls?”

Consider a Java method with a Double parameter. You pass uninitialized ActionScript Number, that is, Number.NaN. What will BlazeDS deserialize (unmarshal)? Double.NaN. At this point your Java code may use something like (value==Double.NaN)?null:value, capitalizing on the fact that information about special value of NaN had been delivered from your client code to your server code. Now, let’s assume you change the signature of the Java method to accept Long instead of Double. You pass NaN and you get … 0! The same happens with marshaling ActionScript object that carries Number.NaN properties: they turn into 0, if, god forbid, their Java counterparties are declared as Long or Integer.

The reason is that while Java has Double.NaN it does not support either Long.NaN or Integer.NaN. Looking at the following snippet of code you can see how differently Double and Long variables get treated by Java:

		 Double dbl = new Double(Double.NaN); // We emulate incoming numeric null
		 System.out.println(dbl); //prints NaN, cause dbl "knows" it came from null
		 long l = new Long(dbl.longValue(new Double(Double.NaN)));
		 System.out.println(l); // Oops, prints 0!

Unfortunately, native BlazeDS flex.messaging.io.amf.translator.NumberDecoder falls into this trap. So, what is to be done? Luckily, BlazeDS is an open source product and this class has to be slightly modified.

Figure 1 illustrates the changes required to protect null-ability of your Long, Integer, etc values, except Double (we explain what to do with Double-s a bit later):

Modified NumberDecoder class  under Deltawalker

Figure 1. Modified NumberDecoder. Farata modification is on the left, canonical BlazeDS class is on the right.

Now, after you make the changes and compile the class against the rest of the flex-messaging-*** jars you can re-jar your own flex-messaging-core.jar.
Better yer, place this class in the common server folder so that it positively affects classpath of all applications on the server.
From now on, Number.NaN will come as Long null, or Integer null – whatever you decide on the Java side.

It this sounds like to big of a deal to you, keep using Double values and convert Double.NaN to null yourself, when appropriate.


Finally, if you would also like to see Double.NaN automatically converted to null, you will have to substitute one more BlazeDS class – flex.messaging.io.amf.translator.NativeDecoder. Explanation: it’s just so happens that BlazeDS marshalling ignores the NumberDecoder when the source (Number, aka Double) and target (Double) types are the same. Here we come and force BlazeDS to use NumberDecoder with numbers no matter what:

    public class NativeDecoder extends ActionScriptDecoder
{
    public Object decodeObject(Object shell, Object encodedObject, Class desiredClass)
    {
    	 if ( DecoderFactory.isNumber(desiredClass)){
    		 NumberDecoder numberDecoder = new NumberDecoder();
         	 return numberDecoder.decodeObject(encodedObject, desiredClass);
    	 } else
    		 return encodedObject;      // the sole original BlazeDS line
    }
}

Source code:
NumberDecoder.java modified by Farata
NativeDecoder.java modified by Farata

I’d like to use this opportunity and invite Flex developers living in Europe to attend our Advanced Flex Master Class in Brussels, Belgium on March 1 and 2, 2010.

Victor Rasputnis

Comments (4)

 

Grey Line

After teaching our popular advanced Flex master class in New York, Boston, Toronto, London, and Moscow we are hitting the beer capital of the world: Brussels, Belgium. This class is scheduled for the first days of March, and we hope that Flex 4 will be officially released by this date. Our book Enterprise Development with Flex should hit the book stores by then too.

To take advantage of the early bird prices register early at http://bit.ly/59DdIU.

If you can’t make it to Brussells, I’ll be glad to meet with you at 360 Flex in San Jose, CA on March 7-10, where I’ll be presenting on one of the topic from this master class.

If you can’t make it to San Jose, I’ll be very happy to meet you at Flash and the City conference in May in New York City. Most likely I’ll show you a really cool way of embedding a Flex application into a PDF file to be played by Acrobat Reader.

If none of these dates/locations work for you, you can always invite us to teach this class privately on site in your organization almost anywhere on the planet Earth.

Yours
Yakov Fain

Comments

 

Grey Line

I had a dream. I had a dream that Adobe’s CTO gave me a call saying, “Yakov, can you help us with writing a roadmap for LiveCycle Data Services for 2010?”
I said, “Piece of cake, Kevin. Just give me a half an hour”. This is what I came out with.

1.    Give a serious bonus to software engineers who created Fiber, a set of goodies behind model-driven development.  Way to go!

2.    Fire that guy who already reached his level of incompetency and said, “If one salesman can sell LCDS licenses for $20K a CPU, everyone can do it”. This  guy is simply killing the product by making it unreachable for lots and lots of corporate clients. Change your state of mind from “these filthy rich Wall Street client should pay” to “each RIA project manager has limited budget”. BTW, have you heard of recession that we are still in?
Remember, when Adobe purchased Macromedia and changed the Flex pricing policy from $15K per server to $700 per IDE people actually started using the product? Why not trying the old trick again?

3.    Charge LCDS evangelists with changing their main message from “Look Ma, No Hands” to “Unleash the superpower of RTMP and custom adapters”. Today, they are preaching to the wrong crowd. Flex enthusiasts who don’t know Java and are developing cool Web sites for their cousins’ video stores won’t be buying LCDS licenses no matter how high you jump. They’ll be happy to use the new Modeler in Flash Builder 4 as a cookie cutter, with free LCDS express edition.

4.    Invest more money in QA to ensure that Fiber’s code generators are not just well written, but are of superb quality. It’s great that you’ve eliminated the need to write Java and configure destinations on the server – people who are not capable of learning Java will applaud you. But generating the in-memory-only code and not giving developers a chance to debug it (if something goes wrong in the generated code) requires top notch quality code interpreter and code generators.  In the 90th, I’ve had excellent experience with  PowerBuilder (Sybase) that did a great job in this department where everything worked as the doctor ordered. But I also had bad experience with BEA System’s Java Workbench IDE that at some point started giving null pointers in the code that was not written by me and was not accessible by debugger.

5.    Usually, enterprise Flex/LCDS developers have to work with existing persistence layers. In Java world, Hibernate and EJB dominate there. Fiber also uses Hibernate in the model-driven development workflow. But what if developers are not allowed to work with DBMS directly and have to use a pre-existing Hibernate layer? It’s not clear how Fiber will  use an existing Hibernate configuration vs. generating a new one.

6.     Ensure that enterprise RIA architects are familiar with such advantages of LCDS over BlazeDS as duplex-by-nature RTMP, reliable messaging, and throttling.  BTW, did I mention that you need to lower the price of the enterprise LCDS license to $5K a CPU?

7.    Start promoting the importance of the load testing on early phases of any RIA project and explain how to use of the new LCDS Java NIO testing tool. Use the lose-weight selling strategy: show the picture of a Flex/LCDS application Before and After.

8.    Purchase Charles monitoring tool and enhance it to allow enterprise  developers to monitor and dissect RTMP calls.

9.    Allow your Flex evangelists publicly admit that even though developer can use MVC Flex frameworks even with Model-driven workflow where the application is generated automatically, it doesn’t bring much value. Really.

10. Ask LCDS evangelists to create a reference implementation of the popular among Java developers Pet Store. Get the existing version over here and do a facelift using Flex and LCDS 3. But make it real including the coverage of all little details that Java EE developers want to know (i.e. how to integrate the new application with existing authentication/authorization service like SiteMinder).

“Wow, Yakov, you came up with a really nice laundry list! What do I owe you?”
“Kevin, if you still have some money left after acquiring Omniture, please send a case of Louis XIII cognac my way. But if you are still recovering, I understand. A case of  Cardenal Mendoza is just fine”.

Yakov Fain

Comments (4)

 

Grey Line

There are about 250K developers working with Flex and AIR. If you add an army of ActionScript developers, this number will grow substantially. Where do you go if you have a technical issue while developing RIA? As of today, there no one place to ask questions and get answers.  A respected forum flexcoders uses the outdated and hard to follow Yahoo! groups.  Some people try to find answers visiting blogs they trust. Some developers post their questions on Twitter.

About a year ago Joel Spolsky and Jeff Atwood released a well designed and easy to follow knowledge exchange stackoverflow.com, where people earn reputation by suggesting the right solutions to people’s problems. Flex/Flash/Air developers started to post their questions there among the plethora of questions on other technologies and programming languages.

Joel and Jeff went one step further and are offering the engine (stackexchange) for creation of similar knowledge exchanges for discussion any kinds of subjects. Using this engine is not free, but our company, Farata Systems continues contributing to Flex community and will pick up the cost involved with running the knowledge dedicated to RIA technologies that produce applications to be deployed with Flash Player.

We are just starting and created a an exchange Built4Flash on stackexchange engine and would like to invite Flex, Flash, AIR, and Coldfusion developers to post questions there and provide answers to others. The URL of the Web site is http://built4flash.stackexchange.com.

Your questions and answers not only will help others in solving their issues, but you’ll also have a chance to  become visible and reputable person in this lively and Flashy community.

I really hope you’ll support this initiative.

Yakov Fain

Comments

 

Grey Line

First, let me ask Java developers a question. Imagine that one day you wake up and read the following announcement, “As of today, Spring framework is the foundation for delivering of successful J2EE projects. In contrast to earlier versions, many parts apply across frameworks. So, if you are using Struts, JSF, and especially Tapestry, just forget about all these complex to pronounce names. From now on, no matter what framework you use, you are actually using Spring’.

Some of you would think, “Yakov is either out of his mind or is writing this blog sitting in one of the coffeshops in Amsterdam”. Wrong! I’m just reading an announcement about the upcoming release of the popular Adobe framework Cairngorm 3: http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm+3

Based on this announcement, even if you are using PureMVC, Swiz, Mate, or whatever else will be invented in the future, you are using Caingorm. Basically, instead of addressing issues of the Cairngorm 2 framework, someone decided to reuse a well recognized brand in rather small Flex community (about 250K developers) and turn it into a set of guidelines.

The Getting Started document reads, “The original Cairngorm library remains a part of Cairngorm 3, but has not been updated for this release.” Two paragraphs down it states, “To migrate from Cairngorm 2 to 3, you should first read the Cairngorm Guidelines to understand how your existing client-side architecture might be improved. This could involve introducing an inversion-of-control container or simply refining the way you use the original Cairngorm library.”

Now I’m confused. If Cairngorm 2 was a framework and Cairngorm 3 is not, what this improvement from 2 to 3 means? Introduction of IoC simply means throwing away Cairngorm 2 in favor of Parsley, Swiz or Mate. Am I missing something?
Cairngorm 3 includes the following libraries: Observer, Popup, Task, Validation, Integration, Module, Navigation.  Several of them “are implemented as extensions of Parsley Application Framework. In order to take advantage of these libraries, you also need to use Parsley”. Wait a minute. Do I need to use both Cairngorm and Parsely on top of Flex framework? If before, you should’ve added to the project one swc of the selected framework, now you’ll need to add a bunch of them. Are we going to build a pyramid of frameworks or something?
Cairngorm tools include Flex Builder (I assume Flash Builder too), Cairngorm 2, FlexCover, FlexPMD, Flex-Mojo for Maven… What if they decide to use our open source ANT script generator Fx2Ant and include it in Cairngorm too? Is this a good thing?

Yesterday, I’ve attended an interesting presentation about disruptive thinking, where presenter kept asking, “What if you could fly?” Applying the same technique, I’m asking myself,  “What if I’m Cairngorm?”

Tried it several times. It doesn’t work so far. Sure, I’ve gained some weight, but it’s too soon to call myself a mountain. But I’ll be there! I can do it! We need a change! For now, I’ll just use this word as my middle name:

Yakov Cairngorm Fain.

Sounds good, isn’t it?

Comments (2)

 

Grey Line

Recently, Adobe decided to stop offering enterprise support for BlazeDS. Here’s an extract from BlazeDS FAQ http://bit.ly/17uzhn:

Does Adobe provide enterprise support for BlazeDS?
We have seen tremendous adoption growth with BlazeDS. However, feedback suggests that the support offerings did not meet the needs of our customers. Therefore, we are no longer offering subscription support for BlazeDS. Instead, customers who require maintenance and support can purchase LiveCycle Data Services ES2. Current customers under a valid support subscription of BlazeDS will have the option to trade up to LiveCycle Data Services ES2 when their maintenance and support agreement comes to an end.”

Over the last two years, Farata Systems was offering various solutions based on BlazeDS often enhancing and extending capabilities of BlazeDS. We are very familiar with the source code of BlazeDS and our Flex and Java experts can support all the needs of your organization around BlazeDS. Support options include all range of services starting from training and first level support to bug fixing and feature enhancements.

Your organization can provide the first level support for the users of the application built with BlazeDS, and Farata Systems takes care of the second level technical support.

Farata Systems can offer your organization the following services:
– a dedicated personnel – 24×7 with limited number of issues/contacts at your organization
– Prepaid blocks of time in 40-hour increments for access to out Flex networking specialists on priority basis
- Customization of the BlazeDS communication protocols if need be
- Increasing of the performance and scalability of BlazeDS-based applications, for an example,
read the following article
- Guaranteed support for 1 year based on product development, with fixed support price thereafter

For more details please fill out the Contact Us form at http://www.faratasystems.com.

Comments (2)

 

Grey Line

At this point I’m working on a couple of new presentations for a bunch of upcoming conferences and  seminars and  that will take place in Flex community world wide.While in the past, I was trying to create cool presentations, now I wantbe even cooler and… deliver a booring one.

This upcoming Monday, I’ll be speaking at the Flash Camp Wall Street in New York City. It has great speakers and the best part is that there’s only has one track so attendees will have nowhere to hide from my talk described below:

A boring presentation on Flex libraries and modules

Everyone have heard of RSLs and “Merged into code” link options. But do you really see the connection between the library linkage and your enterprise application performance? Do you know what and when goes over the wire to your users? Do you really understand the difference between the RSL and External linking of Flex libraries? Do you know when to use libraries and when to use modules? Do you know the difference between modules and sub-applications? Do you know how to arrange for a smarter RSL downloads? If you answered “Yes” to most of these questions, don’t waste your time attending this presentation cause it’ll be so boooring for you.

In two weeks my colleague Victor and I will be teaching our advanced Flex 2-day workshop that becomes more and more popular. Moscow, Russia becomes our next destination after New York, Boston, Toronto and London.  If you can read Russian, here’s the link for you. In the first quarter of 2010 we are planning to run it in Warsaw, Poland and Kiev, Ukraine.
One person told me that it’s stupid to go to freezing Moscow in December. No biggies. We like cold vodka.

In March, I’ll be presenting at 360 Flex in San Jose . I love this conference for developers and by developers. If  I’d be sentenced to spend the rest of my life in a desert island and was allowed to take only one Flex conference with me, I’d take 360 Flex.  During this event I’ll show a cool little Flex application that lives inside the PDF and is played by Acrobat Reader.

Flash and the City is the new kid on the block.  Check it out: http://www.flashandthecity.com/#page=AllSpeakers .  Excellent faculty and aggressive pricing will bring several hundreds of Flex and Flash developers to New York City.  If everything goes as planned, I’ll be able to demo something that’s slowly brewing at Farata Systems under the working title “Fluid PDF Forms”. Duane Nickull’s band 22nd Century will be on stage helping attendees to forget everything they’ve learned in the classrooms.

I’ve mentioned just the conferences where I’m involved as a speaker. But there will be plenty of other gatherings of Flex developers during the same period of time. Be there.

Yakov Fain

Comments

 

Grey Line

Great Java IDE IntelliJ IDEA is available for free in the Community Edition flavor. This is good news, but IMO, it’s a little too late.

I’ve recorded the podcast where I explain my point of view.

Yakov Fain

Comments

 

Grey Line

In the upcoming months, Farata’s principals are going to run or participate in the following public and private training events:
1.    November  5-20, 2009, Saudi Arabia, private client
Adobe Certified training “Development of the RIA with Flex”
by Victor Rasputnis

2.   November 6, 2009, Atlanta, GA, private client
Advanced Flex Seminar
by Yakov Fain

3.    November 16-17, New York City, NY
Flex Camp Wall Street, http://www.flexcampwallstreet.com
Yakov Fain will present on Flex library linking

4.    December 7-8, Moscow, Russia
Master Class: Development of software with Adobe Flex,
http://www.eventbrite.com/event/458588651
by Yakov Fain and Victor Rasputnis

During January – April of 2010 we are planning to run our popular 2-day Advanced Flex training event in Austin, TX, Denver, CO, and Rio de Janeiro, Brazil. Stay tuned.

Yakov Fain

Comments

 

Grey Line

The online publication RIARevolution.com covers everything related to development of rich Internet applications has published an interview with me as a part of the audio podcast Speak Rich. You can download it as an mp3 file or just listen to it at the following Web page: http://bit.ly/2kwOzT

In this interview we are talking about recent Adobe MAX 2009, using Flash for developing application for iPhone, upcoming Flex 4 framework, open source Clear Toolkit framework, the new book on Enterprise development with Flex  and more.

The other episodes of Speak Rich podcast are featuring the following well known software engineers:

Chet Haase, a member of the Adobe Flex SDK team
Stuart Stern, creator of a testing framework Flex Monkey
John Resig, creator of the famous JavaScript library and toolkit — jQuery

You can subscribe to this podcast at http://riarevolution.com/category/speak-rich/

Yakov Fain

Comments

 

Grey Line

This was my second MAX and, let me tell you, I enjoyed it a lot more than last year’s one. This was an intriguing event with lots of interesting news, and promises of new releases.
Being in  Los Angeles added some coolness to MAX as everyone there has the same goal: to run into a celebrity in restaurant, store, on the street… somewhere. It’s Hollywood, you know… Sure enough, I ran into couple of celebrities and even shook hands with them: Ely Greenfield and Ted Patrick. Who’s bigger than them in Flex community? I mean among those who’re in the know.

But let’s get back to business. The breaking news goes first.

Flash Player 10.1

Flash Player 10.1 is THE news of MAX 2009.  During the keynote, Kevin Lynch (OK, Okay – he’s also a celebrity) has demonstrated serious performance improvements and modest battery consumption by this VM. Right at this moment I felt how four thousand hands, in the dark, pulled out their iPhones (the rest of attendees were carrying free Blackberries of their employers). The tension in the air reached its climax as Kevin announced that with Flash Player 10.1 smooth rendering of a 3-hour movie on smart phones became a reality.

But when he said that Adobe had an agreement regarding Flash Player 10.1 with 19 out of 20 major producers of mobile devices, four thousand iPhones were returned back into pockets, purses and other belt holders. No, not this year. Apple doesn’t want to lose control over the distribution channels of applications for iPhone, and by not letting Flash Payer in the iPhone browser they are not letting me, you or him distribute our applications to the users via Flash Player.

If before MAX 2009 I was positive that Flash Player wouldn’t make it this time, now I can bet three to one that by MAX 2010 Apple will surrender. From Flash Player’s perspective, the mobile landscape will be substantially different a year from now. Competition to iPhone will keep increasing, and if today a modern Flash Player is technically non-existent in the mobile space, a year from now vast majority of these devices will run its latest version.

Apple won’t want to be the only device that shows lots of Web sites in a crippled form. Besides, enterprises and private developers won’t stop developing Flash-based RIA just because iPhone doesn’t support them.

On the positive note, Adobe announces that the upcoming Flash Pro CS5 will allow developing  applications for iPhone in ActionScript. Selecting iPhone in a deployment ComboBox will extract the ABC code from a regular SWF, and run it through the  LLVM optimizer/compiler linking all required libraries to run natively on iPhone’s ARM processor. Developers can test their new creation on the iPhone hooked up via the USB port.  After the testing is complete, the application will go through Apple reviewers, and if approved, it’ll be signed and added to Apple Store.

By doing this Adobe kills (at least) two birds with one stone. First, it’ll allow legions of ActionScript developers start working with iPhone without the need to learn not too friendly Objective-C. Second, many new developers will purchase Flash Pro CS5 just for this reason alone.

Flex 4

Flex 4 is a serious re-write.  If release of Flex 3 was a set of additions to Flex 2, this time we are facing a major change of this framework.  Developers will get a brand new set of Spark UI components. Flex engineers separated skins from the functionality of these components – they are lighter, and skinning can be done by graphic designers while developers worry about the functionality. To put it simple a Button doesn’t know how it looks. And the look can be changed without the need to modify the code of the button itself – just assign it a new skin component, and off you go.

Flex team is working on maintaining complete compatibility between the new (Spark) and old (Halo) components and we should be able to mix and match them, but for new projects it would be very hard to justify using the old set from the mx namespace.
Enterprise developers will enjoy working with new item renderers in the List based components. They support variable size items including dynamic grow/shrink, and the renderers are created only for items that are displayed.   Now lists support data-specific rendering  – you can use a callback function in place of an itemRenderer. The row data is passed to a function, which returns an appropriate renderer. We’ve been using these techniques for years (in Clear Toolkit components) by implementing a customized class factory, and it’s great that Flex 4 lists will get similar functionality. Spark renderers also support states and transitions.

Newly introduced Group and Data Group have scrolling APIwithout having scrollbars – just wrap them into a Scroller component (btw, pixel based scrolling is there too).
I really like new layout managers: custom layouts (wheel, spine, cover flow), list items don’t have to be rectangular any longer, you can use relative layouts, program post-layout transformations…
If you are Flex developer, allocate some time in your schedule for learning Flex 4 goodies.

LCDS 3.0

Lots of improvements are in the works on the server side too. LCDS will support reliable messaging and throttling (limiting the number of messages per destination or client).  Adaptive throttling sounds interesting too – the client application can control the data feed. It can command the server “slow down, I can’t keep up” or “give me more, I’m idling”.
A couple of years ago our company was working on a trading application for a financial company, and we had to manually implement throttling on the RTMP protocol level to ensure that the server won’t push the price quotes to the client in the congested network situations. The new LCDS should support this feature  by introducing conflate parameter. Adobe will offer this feature only for Data Management Services though.

The LCDS Edge server will allow partitioning of the applications across multiple network tiers with optimized server-push performance.

I’d like to take for a spin a Java-based load-testing tool for LCDS, which should let you create thousands of clients hitting your server. This is not exactly the real-world situation where the Web browsers introduce additional constraints, but at least it can give you an idea if your online gaming application can work with a thousand of concurrent users or will put the server to its knees a lot sooner.

Model-driven design and new wizards in Flash Builder are not to be missed too.  I’ve allocated a week in November for learning just this workflow alone.
Adobe, lower the price for LCDS, I mean get real. Five grand per CPU for the enterprise license sounds fair.

AIR 2.0

Unless you are creating a self-contained AIR 1.5 application, the need of integration with other non-AIR software leads to creation of convoluted architectures that require introduction of Java or C++ parts and the need of integration with them. It seems that AIR 2.0 will allow building applications that can directly launch and communicate with native applications (google for the NativeProcess class), automatically open files open by default applications, and access some of the popular devices in the USB ports.

Add to it lower memory consumption and support of the UDP-based peer-to-peer communication (DatagramSocket class), PC network detection (NetworkInfo) and you are getting really appealing platform for developing desktop applications.

Flash Catalyst

This tool remains a bit fuzzy for me. I’m still trying to find the use for it in a real world scenarios when designers and developers have to work in parallel on the same project.  Unless they will be able to seamlessly send generated and refactored code in both (designer-developer)directions, it’ll remain a prototyping tool. But let’s wait for a general release of this tool next February before jumping into conclusions.

My Wishes for MAX 2010

Overall, other than traditionally dead wi-fi, the conference was organized really well. My only wish for MAX 2010 (October 24-27, 2010 in LA) is to get read of the junk food presented as box lunches. I still remember the gourmet food of the first day of MAX 2008. Based on the fact that our company can hardly keep up with growing demand for Flex developers, I can confirm that economy is recovering really fast, and I hope that things will go well for Adobe too and they will pass some of the surplus  to us in a form of rack of lambs, Chilean sea bass,  and creme brulee for all attendees of MAX 2010.

This was a brief summary of technical news that caught my attention while attending Adobe MAX 2009.

Yakov Fain

Comments

 

Grey Line

Once in a while, Flex developers who trust us ask for some formal writeup that would help them convince their managers that hiring Farata Systems to help with their enterprise RIA project is the right thing to do. Hence, this post contains the data from our marketing brochure. Since the readers of this text are not expected to be familiar with nitty-gritty details of development with Adobe Flex, we tried not to use many technical terms here. But if you need to convince a technical person that we know Flex Framework inside out,let us know and we’ll start using jargon.

The main goal of this short write-up is to answer the question that our perspective clients must ask themselves, “What are the advantages of hiring Farata Systems to help with our project versus many other vendors working in the same field?”

During the last 3+ years Farata Systems primarily works on development of enterprise Rich Internet Applications (RIA) utilizing Adobe Flex and AIR technologies on the client and J2EE in the server side. Besides working as consultants, we also develop reusable components and tools to improve productivity of  Flex/Java developers.  For example, we created a CRUD generator, a logger, an ANT script generator, Java/Flex DTO generator, and a library of enhanced Flex components. We’ve open sourced these components and tools under the name Clear Toolkit, see http://sourceforge.net/projects/cleartoolkit – all this software is available at no charge under MIT license.

O’Reilly is about to release a book “Enterprise Development with Flex” written by three founders and business partners of Farata Systems. This is their second advanced book devoted to enterprise application development with Flex and Java. The book covers the best practices and shows concrete examples of creation of enterprise-grade components and enhancing communication protocols offered by Adobe. Besides being an advanced and well researched manuscript, this book stands out among other Flex books available on the market because it’s printed as a part of Adobe Developer Library, which required approval of the authors by the members of the Adobe Flex Team.

Farata’s Flex and Java experts are invited to speak at several major conferences each year worldwide, including Adobe Max conference.

Below is a short summary of what Farata Systems brings to the table of any enterprise that develops RIA with Flex.

1.    Farata Systems doesn’t hire junior developers. Based on our experience, some enterprise managers make a serious mistake by hiring the least expensive offshore developers who either went through a short Flex training or just spent several months of the real-world development with Flex.  Even though Flex is a relatively simple tool to start working with, lack of understanding of its internals leads to creation of slow to load, poorly performed and not scalable applications. Pretty often, Farata’s engineers are being hired for helping to fix the issues in the projects that were developed by other vendors, but it’s not always easy to fix enterprise applications that were initially architected in a wrong way.

2.    When hired for a project, Farata’s engineers start with trying to deeply understand the internals of the customer’s application, which allows them to suggest optimization of each tier of RIA. In some cases, they suggest smarter messaging on the server to lower the number of created threads. Sometimes, it makes sense to split the business traffic over different communication channels to improve the round-trip time. Special attention is being paid to splitting large enterprise into a set of loadable on demand libraries and modules, and this is done on the early stages of the project.

3.    Adobe offers two products supporting efficient communications between client and server tiers. One of them is a robust and scalable product is called LiveCycle Data Services (LCDS), but its licensing costs thousands US dollars per each CPU utilized on the server. There is an open source and free solution Adobe BlazeDS, but it’s not scalable off the shelf. Farata’s engineers invested substantial amount of time experimenting in the area of improving robustness and scalability  of BlazeDS, and were able to create a solution for BlazeDS installed under Jetty Server that can support at least 5000 concurrent users. The results of this research and a video recording of the stress test of this solution has been published in this blog. For some enterprise applications the ability to switch from LCDS to BlazeDS means savings of $100,000 or more.

4.    The speed of the client/server data roundtrip is crucial for success of many RIA, especially for those that process high-volumes of data in the real time. The roundtrip time depends on many factors (the distance between the client and server, the number of hops for each packet, the speed of up and down streams et al.) Farata Systems architects know how to customize the implementations of the communication protocols base on the specifics of each customer’s environment. For example, recently we’ve implemented customized communication protocols for a financial trading application adding such features as
- throttling (to handle the cases when the server pushes too many messages, but the network is congested)
- adding application-specific information to the headers of the underlying messages between Flex and LCDS
- improved reliability of the protocol by adding recoverability in case of lost connection
- processing of the out-of-sequence messages.

5.    People often judge the application’s performance by the speed of appearance of the main view of the RIA. Knowledge of Flex internals allows us to design and fine-tune the startup process of the Flex-based RIA to make them appear on the user’s monitor as quickly as possible.

6.    Some enterprise RIA require generation of various reports.  Development of reportsin Flex  requires allocating substantial time and human resources. Farata  Systems created a reporting tool (ClearBI) for Flex applications that leads to tremendous productivity boost in this area.

7.    Each of Farata’s consultants knows how to use components from the mentioned above Clear Toolkit framework, which is yet another reason of making then more productive than an average Flex developer.

8.    Farata’s experts contribute to Flex community maintaining a highly-regarded technical blog where we publish commentaries and share best practices, tips and tricks useful for many Flex developers. The blog is located at http://flexblog.faratasystems.com.

Testimonials

The development team at Farata Systems is capable of delivering any size Flex development project. Their lead engineering and management personnel are some of the best engineers in the business.  They show real leadership in combining the best of Java and Adobe Flex. I highly recommend Farata Systems

Ted Patrick, Platform Evangelist, Adobe Systems

Farata Systems continues to impress me with consistent leadership and knowledge. Their understanding of the RIA space is unmatched. After working with some of the largest Flex developers in US I am convinced we found the best. Farata’s team took our application from a crippled on-demand platform to something we use daily with clients across United States
Aaron G. Blackledge, CTO, Future Systems Advisors, LLC

I wish every vendor would be as easy to work with as Farata Systems. Complex components made for us by Farata have saved us time and money. They proactively helped to fine tune design specifications, and beat the             deadlines. Their turnaround for the code modifications was lightning fast. We are planning to work with them again
Mica Endsley, President, SA Technologies


Without Farata’s Clear Data Builder we wouldn’t have chosen Adobe
Flex
Niel Reuben, the founder of a Silicon Valley startup
Listen to what Mr. Reuben had to say at http://myflex.org/demos/Niel_on_CDB.mp3

Comments

 

Grey Line

This podcast is about the closing  day of Adobe MAX 2009: http://nobsit.libsyn.com/
How I understand the iPhone/Flash situation
Good read about AIR 2.0
The Adobe MAX 2009 videos for developers are published the next day!

Yakov Fain

Comments

 

Grey Line

I’m continuing covering Adobe MAX 2009 in Los Angeles. This podcast is about the day 2 at the conference: http://nobsit.libsyn.com/

Yakov Fain

Comments

 

Grey Line

I want to congratulate Adobe on the very impressive show they put tonight called “Adobe Sneaks”. The message they conveyed was that these outstanding pieces of technology were actually “play code” written by Adobe engineers either in spare time or as proof of concept. And the audience was very clear on both power of Adobe Platform and ability of Adobe engineering to deliver extraordinary results.

Couple of smaller sneaks really puzzled me. I am sucker for development productivity and the teaser that allowed you to do code editing while still in debugger session seemed like the greatest productivity boost while providing better developer experience then (my previous benchmark) VisualBasic 6 in-place debugging. For large projects it SAVES HOURS EVERY DAY and allow developer to stay focused on the code writing and debugging instead of going through lengthly mindless process. This is the top feature I want in the next Flash Builder. It took me 3 beers during bash to figure it out – was not trivial (I hope – can’t be sure till tomorrow morning;)) :

The replacement unit is the modified function and not the statement itself or class. Adobe would have to modify compiler/debugger to do MIR or LLVM of the AS3 code and in-place JIT, but once it is done you can do the magic. In case of the modified function being on execution stack, revert the function context to the last entrance point in the modified function and fast forward to the breakpoint – you have in-place editing while debugging. MIR/JIT integration is coming to the FlashBuilder as a part of Mobile Kit integration, and can be incorporated as a layer of compiler callbacks in debugger context. Depending on the integration of native compiler into tool chain it can be feasible enough to do it to the code in constructors or code that gets into _init sections but even pure function replacements will get 99% of the expected functionality.

The best side effect is that in debugging you really need to re-run the last executed statements and scoping to function does just that. Great job, Adobe.

There is no doubt in my mind that Adobe is very close of turning this platform into software revolution over the next few years. I am certain enough that I bought Adobe stock today regardless of the current economic situation as long term impact of their platform is so great.

Sincerely,
Anatole Tartakovsky

Comments

 

Grey Line

Flex 4 is a huge upgrade – after all it is a complete rewrite of virtually every bit of Flex code. It requires formal retraining or at least completely open mind and few weeks of going through samples that come with Flex 4 and understanding the differences and capabilities of the NEW platform.

This morning I went to the session Model-Driven Development with Flash Builder and LiveCycle Data Services. It was presented using newly minted Flex 4 beta and unlike the beta 1 that I had to fight through to make the sample to build, the wizards and code generators in beta 2 generally worked. There were some “gotchas” in the process but they were either simple to figure out or even had understandable error message so it is quite passable for the Beta product.

But the thing that was crucial for me to watch people in the room. Aside from typical problems of the front-end developers with Eclipse, a surprising number of people sailed through examples with reasonable understanding of the process. The crucial piece in making the non-trivial process of developing a multi-tier application manageable was correct placing of integration in the middle, and visual integration of the functionality directly into Flash Builder painters and property sheets.

There are other non-engineering components like pricing, but this release finally has potential of making LCDS easy enough for developers – assuming it works. It also gets Flash into top rank of RAD tools – for those who will adopt this development model.

As soon as I complete my current Flex projects in release stage, I am switching every new one to Flex 4/LCDS modeling. Flex community can expect the following new goodies from in a Clear Toolkit framework:

• Farata Systems will provide a native (SQL) adapter for data management compatible with Flex 4 later this year.
• Clear Data Builder will have a plugin to synchronize the data model and SQL adapters
• The missing features like client driven transactions will be added to Flex 4 code generators
• Forms and controls artifacts that are not to my liking as this is definitely the first version of this technology will be merged with the Clear Data Builder stack

Sincerely
Anatole Tartakovsky

Comments off

 

Grey Line

Published a new episode of my No BS IT podcast covering Adobe MAX, Monday, Oct 5 2009: http://nobsit.libsyn.com/.
Features of Flash Player 10.1: http://labs.adobe.com/technologies/flashplayer10/features.html

Stay tuned.

Yakov Fain

Comments

 

Grey Line

Adobe announced Flash code generator for iPhone and I am very confused. I do not care if it makes trivial port of Flash games – iPhone does not really lack games. While people call it half step in the right direction, it does nothing for me or any Flex developer. Kevin Lynch communicated the amount of frustration Adobe had with this integration, but I believe that keeping pressure on Apple and continue working on competitive platforms would be more productive.

However, it is announced and will be out in few month (still to be defined) and we need to start working with it ASAP – as people do need mobile computers. I went through few sessions that talk about challenges in development for mobile platform and I do understand that challenges of Mobile platform are too great to hope for simple port. So we will need to add this tool and start thinking/practicing using this model so we can help developers when the product is released.

Underlying technology is not disclosed , just shown add-hoc “Save As” target in Flash Pro CS5 to generate ARM/iPhone code. From the presentation, it looks like they built very limited player as bootstrap code for iPhone, connected ARM codegenerator to MIR/LLVM processor, applied that to generated SWF, linked to bootstrap and produce now native iPhone application. Till I load these applications in my iPhone and find time to look at it more carefully I would assume it is the process.

But here is the second problem – and that is more of personal issue. Are we ready to let Apple force us to compile HTML page and submit it to Apple store every time we decide to write something?

Today 9 out of 10 attendes of Adobe MAX carries iPhone – including me. The percentage of early adopters and trend setters is very high here. IMHO, right now Adobe holds the key to success to Palm/Blackberry/Google platforms.

Sincerely
Anatole Tartakovsky

Comments

 

Grey Line

Published the next podcast covering my participation in the conference Adobe Max 2009: http://nobsit.libsyn.com/

Started while driving to the airport and finished in LA. How I spend my first day in LA, and the first major software announcement at Adobe MAX 2009: http://flex.sys-con.com/node/1130905

Till tomorrow…

Comments

 

Grey Line

This is the first in a mini series covering my participation in a great event called Adobe MAX 2009 that will take place in Los Angeles, CA on October 4-7, 2009: http://nobsit.libsyn.com/ .

Stay tuned.

Yakov Fain

Comments

 

Grey Line

If you don’t want to wait until the next stable build of Clear Toolkit plugins will be published on sourceforge, you can get all the current sources from CVS and create the fresh build. Go to Sourceforge https://sourceforge.net/projects/cleartoolkit/ and download the file SettingEnvironmentForClearToolKitDevelopers.pdf deom the General Docs section.

This information is also useful if you’d like to become a contributor to this open source project.

Buy Cheap Nero 8
Buy Cheap Apple iWork08
Buy Cheap Guitar Pro 5.2
Buy Cheap Sony Vegas 6.0
Buy Cheap Nero 7 Premium
Buy Cheap Adobe Encore CS3
Buy Cheap Adobe GoLive CS2
Buy Cheap Adobe Presenter 7
Buy Cheap Adobe Audition 2.0
Buy Cheap Adobe Audition 3.0
Buy Cheap Adobe Premiere 2.0
Buy Cheap Sony Vegas Pro 8.0
Buy Cheap Virtual CD v6.0.0.5
Buy Cheap Adobe InDesign CS2
Buy Cheap Adobe InDesign CS3
Buy Cheap Adobe InDesign CS4
Buy Cheap Autodesk Maya 2008
Buy Cheap Cakewalk Project 5
Buy Cheap Adobe Fireworks CS3
Buy Cheap Adobe Font Folio 11
Buy Cheap Adobe Atmosphere 1.0
Buy Cheap Adobe Encore DVD 2.0
Buy Cheap Adobe FrameMaker 7.0
Buy Cheap Adobe FrameMaker 8.0
Buy Cheap Adobe FrameMaker 9.0
Buy Cheap Autodesk 3ds Max 8.0
Buy Cheap Autodesk 3ds Max 9.0
Buy Cheap Corel Photobook 10.3
Buy Cheap Sony Sound Forge 9.0
Buy Cheap Steinberg Nuendo 3.1
Buy Cheap Adobe PageMaker 7.0.1
Buy Cheap Adobe Soundbooth CS3
Buy Cheap Microsoft Money 2004
Buy Cheap Adobe Dreamweaver CS3
Buy Cheap Adobe Dreamweaver CS4
Buy Cheap Adobe Illustrator CS2
Buy Cheap Autodesk 3ds Max 2009
Buy Cheap Autodesk AutoCAD 2006
Buy Cheap Autodesk AutoCAD 2007
Buy Cheap Autodesk AutoCAD 2008
Buy Cheap Autodesk AutoCAD 2010
Buy Cheap Adobe Premiere Pro 1.5
Buy Cheap Nero 9.2.6.0 Final
Buy Cheap Adobe Premiere Pro CS3
Buy Cheap Macromedia Fireworks 8
Buy Cheap MS Office 2000 Premium
Buy Cheap Pinnacle Studio 9 Plus
Buy Cheap Propellerhead Reason 3
Buy Cheap Adobe After Effects CS3
Buy Cheap Adobe Photoshop CS v.8.0
Buy Cheap Cakewalk Music Creator 4
Buy Cheap Corel Painter IX for Mac
Buy Cheap FileMaker Pro 9 Advanced
Buy Cheap Macromedia Dreamweaver 8
Buy Cheap Microsoft Frontpage 2003
Buy Cheap Adobe Photoshop CS2 V 9.0
Buy Cheap Macromedia Authorware 6.5
Buy Cheap Macromedia Captivate v1.0
Buy Cheap Microsoft ISA 2000 Server
Buy Cheap Adobe InDesign CS V 3.0 PC
Buy Cheap Atomix Virtual DJ 5.0 rev5
Buy Cheap Macromedia FlashPaper v2.0
Buy Cheap Traktor DJ Studio 3.2.1.030
Buy Cheap Adobe Photoshop CS for Mac
Buy Cheap Adobe Photoshop Elements 5
Buy Cheap Adobe CS4 Master Collection
Buy Cheap Adobe Photoshop Album V 2.0
Buy Cheap Adobe Premiere Elements 1.0
Buy Cheap Adobe Premiere Elements 2.0
Buy Cheap CyberLink PowerDirector 6.0
Buy Cheap CyberLink PowerProducer 4.0
Buy Cheap Microsoft Visual FoxPro 8.0
Buy Cheap Adobe Fireworks CS3 for Mac
Buy Cheap Adobe Photoshop CS2 for Mac
Buy Cheap Adobe Photoshop CS4 for Mac
Buy Cheap Adobe Photoshop Lightroom 2
Buy Cheap Autodesk Autocad 2009 32bit
Buy Cheap Autodesk Autocad 2009 64bit
Buy Cheap Cisco Network Magic Pro 5.1
Buy Cheap CorelDraw Graphics Suite X3
Buy Cheap CorelDRAW Graphics Suite X4
Buy Cheap Corel Procreate KPT Effects
Buy Cheap CyberLink PowerDVD 6 Deluxe
Buy Cheap Macromedia Studio 8 for Mac
Buy Cheap Microsoft Money 2006 Deluxe
Buy Cheap Portrait Professional Max 6
Buy Cheap TechSmith Camtasia Studio 4
Buy Cheap Acronis True Image Home 11.0
Buy Cheap Adobe Photoshop Elements 4.0
Buy Cheap Adobe Photoshop Elements 6.0
Buy Cheap Ashampoo Burning Studio 7.21
Buy Cheap Atomix VirtualDJ 4.3 for Mac
Buy Cheap Adobe Acrobat 9 Pro Extended
Buy Cheap Adobe Creative Suite for Mac
Buy Cheap Adobe Flash CS3 Professional
Buy Cheap Adobe Photoshop CS3 Extended
Buy Cheap Adobe Photoshop CS4 Extended
Buy Cheap Microsoft Visual Studio 2008
Buy Cheap Native Instruments Absynth 4
Buy Cheap Pinnacle Studio Ultimate v12
Buy Cheap ZoneAlarm Pro 8.0.015.000.XP
Buy Cheap Adobe Photoshop Lightroom 1.1
Buy Cheap Adobe Photoshop Lightroom 1.3
Buy Cheap Microsoft SQL Server 2008 x86
Buy Cheap Microsoft Windows Home Server
Buy Cheap Adobe Acrobat 7.0 Professional
Buy Cheap Adobe Acrobat 8.0 Professional
Buy Cheap Adobe Illustrator CS V 11.0 PC
Buy Cheap Ashampoo Burning Studio 8 2009
Buy Cheap Microsoft MapPoint Europe 2009
Buy Cheap Microsoft Plus! for Windows XP
Buy Cheap Microsoft Windows Server 2008
Buy Cheap Autodesk Building Systems 2006
Buy Cheap Macromedia Fireworks 8 for Mac
Buy Cheap Macromedia Flash Pro 8 for Mac
Buy Cheap Microsoft Office 2007 Ultimate
Buy Cheap Adobe After Effects 6.5 for Mac
Buy Cheap Corel Smart Graphics Studio 1.1
Buy Cheap Microsoft Expression Studio 1.0
Buy Cheap Macromedia Flash Professional 8
Buy Cheap Microsoft Windows Vista SP2 x64
Buy Cheap Windows XP Media Center Edition
Buy Cheap Adobe After Effects 7.0 Standard
Buy Cheap Microsoft Office 2007 Enterprise
Buy Cheap Microsoft Office XP Professional
Buy Cheap Microsoft Windows Vista Business
Buy Cheap Microsoft Windows Vista Ultimate
Buy Cheap REALbasic 2007 Release 5 for Mac
Buy Cheap Cakewalk Sonar 4 Producer Edition
Buy Cheap Cakewalk SONAR 6 Producer Edition
Buy Cheap Cyberlink PowerDVD Ultra Deluxe 7
Buy Cheap Microsoft Frontpage 2003 (DEUTSCH)
Buy Cheap Microsoft Visio 2003 Professional
Buy Cheap Microsoft Visio 2007 Professional
Buy Cheap MS Windows 2003 Enterprise Server
Buy Cheap Borland Delphi 7 Studio Enterprise
Buy Cheap Cakewalk Music Creator Pro 24 2004
Buy Cheap Microsoft Office 2008 Home Student
Buy Cheap Adobe Acrobat V 6.0 Professional PC
Buy Cheap Photoshop CS3 Premium Learning Suite
Buy Cheap Symantec Norton Save & Restore 2.0
Buy Cheap MS Windows XP Professional with SP1 Buy Cheap Adobe Acrobat 7 Professional for Mac
Buy Cheap Adobe Flash CS3 Professional for Mac
Buy Cheap Adobe Photoshop CS3 Extended for Mac
Buy Cheap Corel WordPerfect Office X3 Standard
Buy Cheap MS Project 2003 Server – Full Version
Buy Cheap MS Windows 2000 Server – Full Version
Buy Cheap Adobe Acrobat 8.0 Professional for Mac
Buy Cheap Adobe Creative Suite 2 Premium for Mac
Buy Cheap Microsoft Visual Basic 6.0 Professional
Buy Cheap Microsoft Exchange Server 2003 Enterprise
Buy Cheap Microsoft Visio 2003 Professional (DEUTSCH)
Buy Cheap Microsoft Office 2008 Special Media Edition
Buy Cheap Microsoft SQL Server 2005 Developer Edition
Buy Cheap MS Project 2003 Professional – Full Version
Buy Cheap MS Windows 2000 Professional – Full Version
Buy Cheap Nero V 6.6 Ultra Edition CD/DVD Burning Suite
Buy Cheap ABBYY FineReader 8.0 Professional Multilanguage
Buy Cheap Microsoft Visual Studio 2005 Professional Edition
Buy Cheap Microsoft Windows Vista Ultimate + Microsoft Office 2007 Enterprise
Buy Cheap Microsoft Windows Vista Ultimate Full Version OEM 64-bit (includes SP1)
Buy Cheap Microsoft Office 2003 Professional (DEUTSCH) with Business Contact Manager
Buy Cheap Microsoft Office 2003 Professional with Business Contact Manager for Outlook
Buy Cheap Microsoft Office 2007 Ultimate + McAffe Antivirus Total + Norton System Works

Comments

 

Grey Line

Three years ago, I was calculating the cost of attending JavaOne conference: http://java.sys-con.com/node/187608.  Thanks to crisis, the conferences got cheaper, but still are not affordable for many software developers.  I’d like to offer you a legal way to get more than 80% off the registration price at Adobe MAX that will take place next week in Los Angeles. But you have to move fast! It’s easy:

1. Today: enroll into a cheapest class in your local community college to get a student ID.

2. Tomorrow: register for Adobe Max for $199 at the following Web page: http://www.adobe.com/devnet/edu/max2009/.

3. Sunday: arrive to LA.

4. Find me at the conference (I’m nice looking and friendly guy wearing black T-Shirt with white letters FARATA) and say, “Thank you, Yakov for saving me about $1200!”. You can easily find me at 12:30PM on Monday at the Community Pavilion where I’ll be hosting a BOF “Enterprise Development with Flex”.

Sorry, Adobe. Please don’t invalidate my pass for sharing this little trick.

Yakov Fain

Comments

 

Grey Line

After running with my colleague Victor an advanced Flex training in London,  we kept asking ourselves, “Why we liked it better than many of similar events from the past?” No, it’s not because London is a nice city to visit. It’s not because you hear dear and darling all the time. The reason is simple – this was the strongest (from the skill set perspective group we’ve ever had).  Go Europe, go! Besides people from UK, we’ve had attendees from Holland, Belgium, Norway and even one person (very strong) from South Africa. Does it mean that European Flex developers are better than American one?

As usual, there was one 90-minute section with a detailed comparison of Flex MVC frameworks.  As usual, I was softly criticizing the use of MVC framework in Flex.  Yes, I can admit that if you are dealing with low-skilled developers you may justify using Cairngorm. IMHO, Mate seems to be less intrusive to your project.  No, I didn’t have a chance to look closely into SWIZ – attending one presentation is not enough for forming an opinion.  PureMVC is over-engineered…

I try to go easy on frameworks in the classroom, because there could be lots of non-technical reasons for adopting this or that framework.   I also know that people who created frameworks are seasoned developers with their vision of how things should be done. No disrespect here. But if they have their vision and are not afraid to promote, I am entitled to have mine, don’t I, darling?
Since we are not in the classroom now, let me use a bit stronger language. If to make a call to a server and display a piece of data on the screen you are using Flex implementations of Façade, Command, Delegate, Proxy, Services, Mediator (which is divided into main and secondary ones), and all these objects have to be properly registered or else….you are nuts. The only excuse I can accept, if you are not a decision maker, and this “architecture” have been forced by another developer. In this case s/he is nuts.

If you are a consultant and suggest such complex but theoretically correct architecture to your customer, I understand (but not approve) your goals  – to keep yourself billable on this project for as long as possible.
If you have a minute, read an article by Joel Spolsky about duck tape programmers. Joel is talking about other than Flex technologies, but it resonates with what I keep promoting for the last 3+ years in Flex community – keep it simple, don’t over-architect your project, be agile, components vs. frameworks. I didn’t hear the term “duck tape programmer” before, but if this means implementing simple solution to deliver the project on time – I’m all for it.

But if being a duck tape programmer can be a good thing, during the last ten years I see a new breed of developers that I call “Google programmer”. No, I’m not talking about people who work for this company. I talk about people whose education consists of googling for code fragments on the as needed basis.  One attendee  stated that he was really surprised when we showed a wealth of information that can be revealed by using the Flex compiler’s option –keep. We’ve been using this option quite a lot to understand what’s under the hood, have you?

Why was -keep such a revelation to this senior developer? Is it because reading program documentation or books on software  is out of fashion in the 21st century?   Googling for the code samples can help when you know what are you looking for. But this –keep is a very good example of what would never be returned by Google unless you specifically ask “How to examine ActionScript code generated by Flex compiler?” Have you ever bothered asking such question?

Each of us, regardless of how senior we think we are, has islands (and gaps) of knowledge and reading books and attending formal training is like a SPA treatment for our minds. That’s why I’m very exited to spending several days in the training rooms at Adobe MAX conference, where I’ll be studying hard new tools and techniques of software development and architecture. Many great developers that will attend this event will definitely give me a new perspective to “obvious things”, and maybe  there is another secret key besides the –keep that will help me in some way  to be more productive and efficient at work.

This year I go there with Victor Rasputnis and Anatole Tartakovsky, and each of us is eager to learn from others and share what we know.

See you at MAX,
Yakov Fain

Comments (1)

 

Grey Line

In ten days I’ll be sitting at the general session at Adobe MAX 09 in LA.  People from Adobe will come up on stage one after another delivering the latest news on the products we all use daily. Here’s my short wish list of the news I’d like to hear:

1.    Flash Player will become available on iPhone at so-and-so date. A year ago I’ve been hearing hints and vague promises that this is in the works. A year later – nothing happened.   It’s great that Flash Player is installed on each desktop connected to the Internet, but this doesn’t cut it any longer. Last year Adobe announced the motto “Mobile first” and it’s time to put the money where their mouth is.

2.    LiveCycle Data Services. If Adobe won’t substantially lower the prices, I feel sorry for their salesmen who try to sell LCDS to the enterprises. Five thousand per CPU for the enterprise edition seems to be a reasonable price for the features it provides comparing to free BlazeDS.

3.    Adobe AIR.  It’s time to let it behave as a full fledged desktop development platform. Allow AIR to start other applications, let it access ports on the user’s machine. Stop being a little pregnant.

4.    Flash Catalyst. This product is being developed for more than two years and I still have hard time trying to understan how it’s useful in the enterprise world. Sure enough, you can use it for a quick prototype, but there are other simple tools that can be used for wireframing and prototyping.  I want to hear at least a promise (with a deadline) of something useful for the real world. Of course, I’m talking about round-trip scenarios when a developer can refactor generated code, and later on, the designer should be able to load this code into Flash Catalyst, make some changes and regenerate the code again without messing up developer’s code. I also want to see how an enterprise project can be started without the need for the developers to wait until the designer’s ready with his/her FXG file.

5.    Flash Builder. The gap between releases of Flex Busined 3 and Flash Builder 4 is getting too wide. I understand, that this serious redesign is caused by introduction of Flash Catalist and by new component skinning architecture, but I want to see some real improvements in performance of Flash Builder 4, which won’t be available till late February of 2010.  I also want to see substantially smaller SWF/SWC files generated by Flex compiler. Modularization and framework caching is OK, but not enough. I want more good news from this department.

6.    The startup of the Flash Player and with the minimal Flex objects (i.e. SystemManager) takes too much time. Even with the use of preloaders with light Flash-only pages, I can’t promise my customers that I’ll be able to design a Flex application that will show the first (any) view of their RIA in less than 2 seconds. Too bad.

7.    I’m really interested to see how this new Flash Platform Distribution Services will pick up in the real world. Will its revenues justify this enormous spending on purchasing Omniture?  I want to hear more about it.

I’m sure people who are using Creative Studio 4 see some room for improvement too,  but this is not my cup of tea and I can’t come up with additional items for my wish list that would please the graphic and Web designers.  But if my seven wishes become a reality, I’ll openly admit that Flash platform is a killer.

Yakov Fain

Comments

 

Grey Line

Today, Adobe made a very interesting announcement – Adobe Flash Platform Services for Distribution is available to the public.  To put it simple, it’s a new way of distributing, promoting, and measuring the usage of your applications on the Web.

Let’s say you’ve developed a Flash RIA (i.e. a game, a movie promo, a stock-market widget) – now you’ll be able to make it available to other people in a viral fashion over the major social networks. You’ll get an API that will let you add the “Share” button similar to the way you can share the video on Youtube. But this button will allow for cross-network distribution and the user will be presented with a choice of social networks to distribute it to.

Developers get a new API to add this Share functionality to their applications. Adobe will also offer sharing these applications between the mobile devices that support Flash platform.  This feature is available for free to anyone. To make it clear, your applications remain hosted on your servers – only an HTML snippet that provides a reference to your applications is distributed.

The publishers who want to promote their product will be able create and run a campaign for a fee targeting specific audiences on the social networks. Say, if you are looking for an application on Facebook, Myspace, iGoogle et al. that explains how to make your belly flat, publishers, who purchased promotions will be able to offer THEIR applications about getting rid of extra fat to  large audiences.  Adobe promises to be able to deliver tens of thousands of installs of your application this way. An additional benefit is that publisher will be able to simply specify social networks they want to use while ordering their promotion campaigns.

The publishers will be offered rich tools for measuring the success of their distribution campaigns. To me, this immediately explained Adobe’s move to pay a premium for Omniture, the company that is in business of Web analytics and optimization.  When I asked Adobe if this new distribution platform and the  Omniture announcement are related, they declined to confirm a direct link between the two events stating that the platform is available today, but the deal with Omniture did not go through yet.  Oh well, you don’t need to be a rocket scientist to put two and two together.

This new way of distribution of Flash based application shows that Adobe is very creative in finding new revenue channels and making Flash Platform very appealing way of distributing applications on the Web and in the mobile space. I know that in the mobile space Adobe is focusing on Windows ME, Symbian S60 (Nokia), and iPhone platforms, but this is all I know. I’m really hoping to hear some major news at the upcoming Adobe MAX conference bringing the latest version of Flash Player to popular mobile devices. But you can use these new  distribution services to spread your iPhone applications too.

In my opinion, introduction of this new distribution platform is the most exciting news from Adobe released in 2009.

For more information about  distributions services read this.

Yakov Fain

Comments

 

Grey Line

A couple of months ago O’Reilly has published this sample chapter of our new book Enterprise Development with Flex. For some reason, they published is as a series of my blogs, but I’m one of three co-authors of this book:

1. http://www.insideria.com/2009/05/chapter-preview-building-an-en.html
2. http://www.insideria.com/2009/05/building-an-enterprise-framewo.html
3. http://www.insideria.com/2009/05/building-an-enterprise-framewo-1.html

Yesterday, one more chapter became available – this time Adobe has published it on devnet: http://www.adobe.com/devnet/flex/articles/flex_performance.html

This book will be printed as a part of the Adobe Developer’s Library. Even though printing of the book is delayed for marketing reasons, you can order an online version of the book over here.

We are using materials from his book during our advanced Flex training. The closest ones are in London in September and in Atlanta.

Yakov Fain

Comments

 

Grey Line

I got an email from an enterprise architect considering Adobe Flex as a platform for Web application development in their organization. This email contained a well prepared  list of questions/remarks/concerns that many of enterprise Web architects may face.  That’s why I decided to publish my short answers to these questions. I didn’t change the wording of the questions/ statements.

Language:

ActionScript3 is a weakly typed language

This is true, and when I started using it I was also getting angry with Flex compiler that wouldn’t catch my obvious mistake. But as you get more comfy in this environment, you’ll appreciate more and more the flexibility of this language. Most of the developers understand something like

var myCustomer: Customer=new Customer();
myCustomer.lastName=”Mary”;

But look at the following notation:

myCustomer[“lastName”]=”Mary”;

The latter instruct the AS3 compiler, “Don’t bother checking if the Customer class even has a property lastName. I know for sure that it’ll be there during the runtime”. Does it look scary? Don’t use it!

Adding a keyword dynamic in the class definition allows you adding properties on the fly. Looks scary? Don’t use it.

To get a better feeling of pros and cons of using dynamic features of the language, read this blog on different styles of programming.

But applications written in dynamically typed languages do require more testing than those written in strongly-typed ones.

AS3 has no support for generics, method overloading, threading, enums, synchronization (handling of a resource e.g. file), annotations.

You need to use a different approach while evaluating domain specific languages vs. the common-purpose ones. Flex is a domain specific language that is not used for developing powerful scalable multi-threaded solutions on the server side. With Flex you are developing just the front end for the applications that are being used by a single user working on his/her computer.
The lack of generics is not a serious drawback (I can live without them in Java too).
Method overloading is not the feature of AS3, but it can be emulated using so called …rest parameter. This is not a showstopper.
From the developer’s perspective, Flex is single-threaded which minimizes the number of mistakes of unskilled (say Java Swing) developers who didn’t put code to refresh the screen into a proper thread, which causes unpredictable results.
Flex has so called metadata markup, which can play the role of annotations. Kinda.
Flex doesn’t support enums, but if this is important for you, consider using a solution offered by Farata Systems in this blog.

For security reasons, the reading/writing in files from Flex application is restricted. In some SharedObject’s may help, but if you need to have full file I/O support consider Adobe AIR.

Difficult to program to enterprise patterns: dominated by event model

While implementing design patterns you should account for specifics of the particular language/environment. Creators of one of the MVC frameworks shoot themselves in the foot by trying to avoid Flex specific event model by introducing more generic Notification class and by implementing Observer design pattern instead of using Flex-specific binding syntax. This approach resulted in creation of overly-engineered and convoluted framework that can be used in several languages, but doesn’t take advantage of goodies available in Flex. You can find some good examples of design patterns implementations in Chapter 2 of the book Enterprise Development with Flex currently available online.

Idiosynchratic binding restrictions and difficult two-way binding; may have been addressed with Flex v4?

The two-way binding is introduced in Flex 4. While being an excellent mean for increasing the productivity of Flex developers, don’t abuse binding. Nothing comes for free and just placing these elegant curly braces actually translates to a bunch of generated AS3 code and may lead to some performance issues in UI-intensive applications.

Poor Collection framework

Yes, AS3 collections are not as advanced as in Java, but they do a decent job if you take into consideration the small size Flash Player where they have to operate.

Generally immature API with numerous traps / pitfalls

ActionScript3 is more than a ten year old language and its current version is stable and doesn’t seem to have more bugs than other languages.

No support for XML schema validation

True. On the bright sight, Flex offers very easy syntax (E4X) for XML handling. But in general, I prefer minimizing using XML, if possible. Sending strongly-typed DTO’s from the server is a lot better way to architect applications.

Platform:

Validation implementation too simple and not extensible

Consider using validation solutions from Clear Toolkit described over here. Validation solutions are extensible in Flex.

Poor error handling due to asynchronous event firing and separation of MXML and ActionScript in components

I wouldn’t use the word poor here.  When you work in asynchronous mode in any language, techniques for error handling are different. When an asynchronous callback is invoked in Flex as a result of the server side call it comes with an argument containing the error information similar to FaultEvent.

Limited printing support

True.  Consider using extended Flex components from Clear Toolkit that offer PDF generation on the client. Read more in Chapter 11 of the book Enterprise Development with Flex.

FlashPlayer 10 does not run on Windows 98 or Windows ME

So? Would you stick to Java 1.1 just because Internet Explorer doesn’t support any further versions of Java?  Stick to Flex 9 if supporting of older versions of Windows is a must.

Flash Player upgrade/compliance to potentially address bugs etc … is an overhead and will depend on customer willingness to upgrade with any frequency. If a customer refuses to upgrade then what?

As of today, there is no other software in the world that can compare with Flash Player in terms of the speed of penetration. The upgrade is extremely easy.  The customer doesn’t want it…This is a problem in a democratic society. If this would happen in Soviet Union, KGB would simply send him/her to a labor camp in Siberia. This technique won’t work in the current enterprise environment though. Just ignore such customers. I know that some people turn off JavaScript support in their Web browsers, but this is not a good reason for not using JavaScript for Web development.

Testing:

Poor / complex unit testing of component behaviour

FlexUnit 4 adds a lot more flexibility for those who want it.

Absent integration testing between Flex client and middle tier

This is not true. The proper use of build scripts (Ant or Maven) in conjunction with such continuous integration tools as CruiseControl allows you to set up an environment that fits your needs.

Absent test automation

This is not true. Look at the open source FlexMonkey or commercial tools like QTP or Neoload

Lack of available testing tools
See above

Build:

Unimplemented build process automation

You might be tired by now by my suggestions to look at the Clear Toolkit, but it includes Fx2Ant tool that automatically generates Ant scripts for your Flash Builder projects.

Complexity:

Asynchronous platform difficult to code safely to resulting in unpredictable/inconsistent behavior

I see no grounds for such accusations. Asynchronous way of communication with the server side components is implemented in an easy to understand and consistent manner.

Complex event driven MVC model overlayed upon Flash’s own event model
Internal Flex MVC model implemented in some components is typically built using binding and is not complex.

Mixing ActionScript and MXML -> complex, unstructured code (flabby code) – not dissimilar to coding JSPs with moderate to large amounts of JavaScript per file

MXML and AS3 code can be completely separated using various techniques. If you are into design patterns, read about the Code Behind over here.

No automated XML serialization support -> complex error prone data mapping and in some cases tests are the only mechanism to capture errors

I recommend minimizing use of XML in favor of strongly-typed data transferred using AMF or RTMP protocols.

No coding standards/guidelines developed to instruct developer’s on how best to develop, what best practice is etc …

Read about coding conventions here. A number of articles/books on best practices in Flex is already available in this number is growing

Follows same paradigm as HMTL/Javascript

I don’t agree. The main difference is that MXML gets automatically converted into AS3, which in turns gets compiled into bytecode. The byte code runs in the browser-independent VM. This is a huge advantage over developing in unpredictable HTML/JavaScript environments.

Code duplication:

Duplication of model across tiers

I wouldn’t call DTO’s that are traveling between the client and the server code duplication.

Duplication of validation rules across tiers

You shouldn’t program duplicate validation rules on the client and the server. Ideally, your Flex RIA should be developed as a stateful client, and you should apply validation logic accordingly without any duplication.

Technology boundary -> business logic tends to bleed into UI

I wouldn’t use the word bleed in this context. RIA with Flex is like a different incarnation of Client/Server technology. In the desktop world, Visual Basic or PowerBuilder also included a portion of business logic. Popularity of thin Web clients was rather a result of the stateless nature of HTTP protocols then business-driven solutions.

Third party support and documentation:

Incomplete IDE support: no refactoring, poor search functionality, missing many productivity features

Agree.  Flash Builder has room for improvements. IntelliJ IDEA may be considered an alternative IDE for some hard-core developers.

Few / immature third party library support

I know more than a dozen of third-party frameworks used by Flex developers.

Few written examples / templates – or too simple – of Flex in the enterprise
Agree, developers need more enterprise-level books and articles. Flex became a serious player on the enterprise market about three years ago and this explains relatively small number of non-trivial coding examples and case studies.  Flex is very easy to get started with, but unless you have an experienced technical leader on your project the chances are that you may create a poorly designed and slow performing application.

BlazeDS has some problems in relation to session management. We would need to rework the code or wait for a release to fix these problems

Consider re-thinking what data should be stored in a session. Ideally 90% of your session data should be stored on the client.

Client / user experience:

Slower startups due to fat client

You need to learn modularization techniques of Flex applications. Unless you are developing a Hello World type application, it has to have more than one SWF.

Requires Flash runtime @ set version with OS support

The ease of Flash Player upgrade makes this a non-issue

General:

Much lower productivity compared to other frameworks; especially around XML transformation

I’d say that Flex is more productive environment than most others that I know about. I’d highly recommend avoiding using XML as a data format for client/server communications.

Much greater testing required due to asynchronous application behavior; testing is tricky as timing affects the results

True. Plan more time for testing of your enterprise Flex applications. On the other hand, you can extend and customize AMF and RTMP protocols (channels, endpoints, and adapters) and wrap them up into a separate layer to add more security, reliability or some business-specific functionality to create Web applications that are a lot more robust than HTML/JS ones.

Steep learning curve: significantly different programming paradigm to Java web development

I wouldn’t call it a steep, but it’s not as easy as Adobe is trying to present. Get the right instructor or mentor.

Code scatter and poor organization leading to poor maintainability
Any event-driven programming environment may have code scattered in several entities but this doesn’t equate to poor maintainability. Based on my real-world experience in such environments (five years in PowerBuilder, two years in Visual Basic and three years in Flex) I can say that they do not require higher maintenance than Java enterprise projects, which I’ve been developing for 10+ years.

Poorer coding experience

The syntax of ActionScript looks very similar to Java and having declarative language for the UI part (MXML) is a trend in all modern RIA tools like Silverlight or JavaFX.

Proprietary technology

I used to hear this argument a lot back in 2006 when I had to convince AJAX proponents that it’s not the best choice for enterprise application. They used to say that AJAX has lots of open source frameworks and they didn’t want to lock themselves in with a proprietary technology from one vendor (Adobe). It didn’t occur to them that with Ajax, they’d definitely lock themselves in with one of the small vendors of the selected AJAX framework.
Flex SDK, BlazeDS and AMF protocol is an open source software  backed by a large vendor. If you don’t like something – get the code and modify it to as you see fit.

BlazeDS 4 has beta release; should we be investigating this version?

Abode has a history of drastically changing the API of the beta software. I wouldn’t advise to start any serious development with beta projects (the same applies to beta versions of Flash Builder 4 and LCDS 3.0). Keep an eye on the beta software but do not invest too much time in it unless you need some feature badly and are willing to keep modifying your application code with every new maintenance release.

Should we be using RemoteObject rather than XML and finding a workaround for the problem of passing nulls between Flex and Java?

Yes, you should be using RemoteObject not just to find a workaround for some problems, but to lower the network traffic, increase communication speed and work in a strongly typed environment.

Flex 4 has beta release; will this release address any of the issues raised above?

I hope that after reading my answers above you’d agree that the word issue is too strong here. Flex 4 will introduces a new set of components, Flash Builder will get new wizards (code generators) and Flash Catalyst that may improve the designer-developer workflow. But this version doesn’t introduce and revolutionary changes that would affect your decisions to use or not to use Flex platform for RIA. I personally try not to fall in love with any technology, and if I see a better RIA tool that can be used with enterprise applications, I’ll definitely consider it. As of today, I don’t see any serious competition to Flex in this space.

Those who are interested in learning/discussing Advanced features of Flex are invited to attend one of the technical seminars ran by Farata Systems. The closest ones are in London and Atlanta.

Disclaimer. I don’t work for Adobe and won’t be rewarded by them in any shape or form for promoting Flex.  I was never shy before and will not think twice discussing real issues in the design/implementation of Flex framework, but since this tool is better than others in the RIA  domain, it deserves appropriate credits.

Yakov Fain

Comments (3)

 

Grey Line

In this 10 minute audio podcast I’ll go over the upcoming Intro and Advanced Flex training public events.

You can get the mp3 file at http://myflex.org/yf/audio/faratatraining1.mp3.

These are the links to the registration pages:

1. Advanced Flex in London : http://www.eventbrite.com/event/355598605

2. Real-World Flex in Atlanta: http://www.eventbrite.com/event/410013361

3. 360 Max proposals: http://bit.ly/zDytj

4. Online Live Intro to Flex: http://www.eventbrite.com/event/414974199

Yakov Fain

Comments

 

Grey Line

I’ve recorded a short conversation with Niel Reuben who was kind enough to share his experience of developing data-driven Flex/Java applications using Clear Data Builder component developed by Farata Systems.

The audio recording is here: http://myflex.org/demos/Niel_on_CDB.mp3

The Clear Toolkit, its source code and documentation can be downloaded from SourceForge  at http://sourceforge.net/projects/cleartoolkit/

Yakov Fain

Comments

 

Grey Line

First of all, to add a little more credibility to what I’m about to write, let me just say that I’m running Princeton Java Users Group (JUG) for years and have a pretty good idea of how organization of the meetings and sponsorship work in such gatherings.
Java community is huge, well established and has a loyal following of leaders and enthusiasts that are willing to spend some of their evenings meeting with their peers and attending presentations by either well known or by no so famous yet presenters.

As a leader of this JUG I often receive emails asking to promote among our members a commercial training event. I do it on one condition: our JUG members have to get some additional benefits from such a vendor, for example, discounted price, free speakers coming over to our JUG, free software licenses…something.

During the last several years, I spent a substantial portion of my time working with Adobe Flex and often fly with my colleagues around the world running either commercial training sessions on behalf of our company or just speaking at the user groups or technical conferences.
While promoting our events I started approaching the leaders of the local Flex/Flash user groups asking them to spread the word about our training session and/or offering to present at their user groups while I’m in town.

To my surprise, pretty often they either just ignore such offers or give a polite response with some lame excuse for not doing this.  Things started to clear up when at one city I was allowed to talk, but was asked not to promote our Flex training because the company that provided the room and pizza was running their own training classes in Flex and were afraid of competition. No problem. Sounds fair.

One of the Flex user group leaders never responds to such offers. Ever. And I tried it multiple times.

In one city, I didn’t get any response to my first email, sent another one and the leaders of that group got back to me – thank you for the offer to speak at our UG, but we are not running any sessions during summer. Fine. You didn’t want me to deliver a technical presentation for free, but why not spreading the word about our technical training and offer a discount to their membership? When we were running the training class in that city, one of the attendees explained me the reason – the local Flex UG is being run by a consulting company that offers Flex services and doesn’t want to allow any competition in the Flex space.

The recent response from yet another UG was very upbeat: thanks for this great offer, we’ll post the information about your event on our Web site. Needless to say that it never happened…

The Web sites of some of the Flex/Flash users groups don’t even provide contact information and the comments to their posts are closed.

It seems to be a trend. This leaves a bitter taste in my mouth given the fact that I often get emails from Flex developers from around the country asking if our company is planning to run a training event in their town. Our events are pure technical, we are happy to share with you pretty advanced tricks and techniques learned while developing our open source projects of during work on real-world projects. We don’t sell anything during these events, and typically, the tuition just barely covers our expenses. Guys, we don’t mind flying to your city, but please talk to your Flex/Flash UG leaders to open their doors.

We’ll keep running our advanced Flex training events anyway. Let’s see if the local Flex User Groups will cooperate in spreading the word about our upcoming training sessions in London (enter the code FLUG at the registration page to get £150 off the tuition) and Atlanta.

Yakov Fain

Comments (1)

 

Grey Line

When a couple of months back I told a fellow Flex developer that I’ll be speaking at CFUnited, conference he shrugged, “Why ColdFusion?”

Little did he know that CFUnited is branded as a ColdFusion, Flex and AIR conference. And this was true – there were lots of quality presentations on Flex and AIR here.

The venue selection was superb – a golf resort in Virginia with three swimming pools and helpful staff.

ColdFusion conference was a new crowd for me, really. People are friendly, and you get a feeling of a small community where people know each other. Finally, I found a technical event with lots of female software developers.

For some reason, ColdFusion developers try to maintain the status of endangered species. Did they learn it from PowerBuilder or Cobol folks? Why would an easy to use server side tool extinct?

If you think I’m making things up, how do you like the masochist title of a general session “CF is Dead…Long Live CF!” Apparently the rumors about this possible death were taken seriously by developers of Indian descent. Most of them jumped the ColdFusion ship. Can’t recall attending an Indianless IT conference for years.

Instead of attending this funeral I decided to spend this hour laying by the pool in my bathing suit. The tanning session was followed by an excellent lunch at the resort’s restaurant, after which I returned back to the classrooms.

Flex for UI and ColdFusion for the server should be a very appealing and productive combination for many business applications. Besides, both product come from Adobe. Flex is like an injection of a fresh and young blood (not Botox) to the ColdFusion community. Flex will revitalize and make them stronger.

This was my first time at CFUnited, and about a month ago I’ve contacted Liz Frederick, a real pro event organizer who put this great show together, asking if I should replace my advanced level preso with a more basic one. Liz checked the number of people signed-up for this talk and decided to stick to the original topic – design patterns in Flex, which was the right decision as my talk was well attended.

If you have any doubts regarding the caliber of Flex presenters, let me just give you some names that are well known in Flex community: Andy Powell, Doug McCune, Ryan Stewart, Jeff Tapper, Tom Gonzales, David Tucker, RJ Owen…

Chatted with Christophe, yes Coenraets on new features of LCDS 3.0. He presented the new features of the product – this time Adobe is making a serious move towards Model-Driven development, and Christophe’s demo looked promising. Expect more reasonable LCDS pricing too. Look for the fresh build of betas of LCDS and Flash Builder 4 next week.

All these people were friendly and very approachable (you’d better be… standing by the pool with a beer or a glass of wine). To make you even more jealous, Adobe pool party included the Sumo wrestling competition. I know who won the Ryan vs. Doug fight, but you don’t.

Food here was as good as on day one of MAX’08, but here it’s consistently good. Once in a while I’m running public training events for our company, Farata Systems, and get used to paying (with tears in my eyes) $40 per person for a boxed lunch. Here we’ve had gourmet food (wild salmon, flanked steak, creme brule…). I hope people could appreciate that event organizers didn’t try to cut corners squeezing out maximum profits from this event.

Oh, by the way, you won’t believe me, but Wi-Fi connection was working ALL THE TIME during the entire event. No kidding!

To summarize, I’m glad that I was invited to this event and looking forward to see all ColdFusion developers healthy and wealthy at CFUnited 2010.

Comments (2)

 

Grey Line

Flex framework includes a pretty useful object that deserves more attention: mx.util.ObjectProxy. You can wrap your object (i.e. Person)  into this proxy which will obediently report on all changes that are happening to this instance of a person.

If you subclass ObjectProxy, you can even add a new  behavior to the wrapped object without touching a single line of its code.

I’ve recorded a short video showing a couple of examples of using proxies in Flex.

This is one of many tricks and techniques that consultants from Farata Systems use while working on enterprise Flex projects, and we’ll continue to share them with you in the form of such mini demos as well as in one of our public seminars like the one on September 24-25 in London, UK (use ebd discount code to get the early bird price) or on October 30 in Atlanta, GA.

For up-to-date schedule of advanced Flex seminars see the section Training  at http://www.faratasystems.com.

Yakov Fain

Comments

 

Grey Line

Don’t create new singletons – just use what you already have.

Each real-world software developer knows at least one design pattern – Singleton. Flex has some specifics in implementing Singletons due to lack of private constructors in ActionScript, but the goal of this little writeup is not to show you how to implement Singleton, but rather to discourage you from doing this because each Flex application already has a singleton – just use it.

I’ve recorded an eight-minute video that will shows how you can use the Application object as your one and only singleton when needed. See if you can answer the question that I asked at the end of the video.

This is one of many tricks and techniques that consultants from Farata Systems use while working on enterprise Flex projects, and we’ll continue to share them with you in the form of such mini demos as well as in one of our public seminars like the one on August 7 in New York City or on September 24-25 in London, UK.

Yakov Fain

Comments (1)

 

Grey Line

In this brief article I’d like to talk about one of the most important aspects of RIA in general and written in Flex in particular – the initial download process.  You application is considered fast for one of two reasons:
1. Well, it is fast
2. It’s perceived to be fast

Today I’ll cover one of the approaches that we at Farata Systems successfully use in literally every enterprise project – designing any Flex application as a portal. There is one exception: Hello World type applications that don’t have any custom styling. Such simple applications can live in a single swf.

Any serious application is technically a portal that consists of a small and light shell application that appears very fast on the user’s machines and downloads (in a smart way) the RSLs that will be needed for the modules lazy loaded modules.

Needless to say that you must always deploy Flex Framework libraries as signed RSLs, which will allow shaving off a substantial amount of downloadable bytes required by your RIA. Unless you have a virgin computer that never seen Flex app, these RSLs will be stored on the user’s disk in Flash Player’s cache (don’t confuse it with the Web browser’s cache).

Now consider an application that has one light-weight main SWF and 10 modules, seven of which include charts. In other words, they rely on datavisualization.swc. During the application startup the SystemManager reads the list of RSL’s from the SWF and loads them with the help of the class of RSLListLoader.

Without going through the advantages of using the RSLs in general, I’d like to mention the fact that Adobe’s class RSLListLoader simply performs loading of all RSLs listed in the generated SystemManager for each module. This means that if the datavisualization.swc was linked in three modules, SystemManager will download it three times (this is the case when this swc was not signed and cached).

We’ve modified the RSLListLoader a little bit so it’ll avoid downloading duplicate RSLs.

One more suggestion for working with modularized applications that use BlazeDS/LCDS – do not create separate services-config.xml files for each of the module. To avoid conflicts, let them reuse one and only services-config.xml listed with the main SWF of your application. This will also allow you to properly allocate work between developers in your team – each of them can have a small test harness application and test his/her modules without the need for waiting when the other modules are ready.

In the following 7-minute screencast I’ll show you the application that has been built in such a way.

People who will attend our Enterprise Flex symposium in New York City on August 7 and Advanced Flex training in London on September will get a chance to get familiar with these techniques in greater details.

Hope to see you there.
Yakov Fain

Comments

 

Grey Line

A perspective client showed me a Web page from Adobe’s Connect Now. Check this page out before reading further: https://connectnow.acrobat.com/

“Yakov, I want our new application to be like that one. The page comes up really fast and it’s very responsive. Can you create our Flex application for us that will be really, really fast? “

“Yes, I can but it requires planning, and applying special modularization techniques”.

Later on, this client’s Web designer shows a well-done design that has a dashboard as a starting page of that RIA. Several nice-looking charts, some aggregated data from database, some data grids. Looks good.

When I asked her to design another yet light-weight view to serve as a home page of that RIA, she resisted – “I want to have very clean design that shouldn’t have anything that is not relevant for the application.”

“No problem, but in this case your application will come up a lot slower than that Connect Now page. That page, if you remember has almost nothing there”.

“But you said you can do it as fast as Acrobat Connect, aren’t you?”
“Yes, I did, but Acrobat Connect’s main page does not have charts, it doesn’t process thousands of database records, isn’t it?”

But guys at Adobe designed that page in a smart way to make the users happy. It not that important if they’ll have to wait (later) for a couple of seconds when the actual work will have to be done…But it’s L-A-T-E-R. That page is perceived to be fast.

Using a dashboard as a starting view of your application means sending over the wire at least one extra 500Kb+ file: datavisualization.swc . If you are using third party graphic libraries, this belly fat can turn into something closer to one meg or even more.

“But I’ve heard that Flex framework can be cached on the user’s computer”
“True, but this is correct for the users who have already worked with yours or someone else’s Flex application that was deployed with datavisualization library as signed RSL (a SWZ file). But there are always users with virgin computers that won’t have that datavisualization library installed. Remember, you only get one chance to make a first expression!”

That’s why, we recommend designing any Flex application as a portal with a very light main page, that gradually, in the background brings other RSLs while the user enjoys working with the main view.

The other very important thing that some IT developers managers must not forget – it’s the SLA. Yes, it the same old service level agreement. And it must be in writing. For example, “The first view of the RIA should be displayed in under 20 second for a user sitting at the 1Mbps Internet connection.” Now we are talking. If you have it in writing and signed off by the users, no one will blame you for delivering a RIA that “feels kinda slow”.

“Thank you, Yakov. Does your company offer some mentoring or an advanced Flex training classes where our developers can learn all these tricks?”

“Yes, we do. I will be talking about performance and other most important usability features of Flex next week at our two-day Advanced Flex training in Toronto that’ll take place next week. During such events we share lots of tricks and techniques for delivering large but responsive enterprise application. “

I know, this is an outrageous into-the-face infomercial, and hopefully the $100 discount code vzw100 will put a smile back on your face when you’ll enter it at the registration page over here: http://www.eventbrite.com/event/353452185

Can’t make it to Toronto? How about a one day symposium New York City on August 7 http://www.eventbrite.com/event/355645746:

Don’t feel like flying to this great but a little crazy city either?

No problem. We can fly to your city and help you with your Flex project on site.

The choice is yours.

Yakov Fain

Comments

 

Grey Line

During the last several years our company, Farata Systems have architected and developed a number of Flex projects ranging from creating widgets for startups to large applications having two hundred views. Some projects were created from scratch, and we had a luxury to do it our way. In some cases we had to pick up the code left by other developers.

Three years ago Adobe Flex has been completely revamped (I’m referring to Flex 2) and nobody knew about it. But today, the word Flex doesn’t make Java developers angry any longer. Java/Flex projects are considered business as usual. Many enterprise Java developers went through Flex training and are ready to roll up their sleeves…

After spending 10+ years with Java I can easily put myself in the state of mind of Java developers – they often start with selecting the right framework. As a matter of fact, our perspective customers often request to include an item “Flex framework analysis and recommendations” in the agenda of our very first joint meeting. Here’s a typical conversation that takes place during such meetings:

“Yakov, we have a team of experienced Java developers and some of them have exposure to Flex. Which Flex MVC framework do you recommend? By the way, does the ABC framework support XYZ functionality?”
“No, MVC-based frameworks don’t support any additional functionality that doesn’t exist in Flex. Their goal is to rearrange your code and change the way components of your RIA communicate with each other. But why do you need an MVC framework for your project?”
“Well, everyone’s using them. Having a framework makes the project development more structured and organized.”

Is it so?

Most of the Flex MVC frameworks are intrusive and require developers to write more code just to support the life cycle of the framework itself. Usually, they are built on singletons, and this complicates modularization of the RIA. I’ve been writing and speaking against Flex MVC frameworks for years, and if you’d like to read a detailed analysis and comparison of some of them, read the first chapter of the book “Enterprise Development with Flex”.
Last year at MAX ’08 conference, I participated in the panel “The Flex architecture faceoff”. Two out of four panelists (Chafic Kazoun and yours truly) were advocating component-based approach without squeezing a RIA inside any MVC framework. It was a lively discussion, and you can listen to its recording at http://tv.adobe.com/#vi+f15384v1055
At this point you may say, “OK, it’s easy to critique frameworks, but how do you approach development of a new project especially while having a distributed team of developers with minimal exposure to Flex?”
And I’m glad you’ve asked this question.
In this article I’ll try to identify common artifacts that exist in literally every Flex enterprise project. I’ll also highlight major principles and introduce you to a component-based approach that our developers use in almost every project.

Flex to Java Communication Protocols

The role of Java side of RIA is to deal with data: get the data from a DBMS, a Web Service or any other data source and deliver it to the Flex client as quickly as possible. The fastest way of arranging Java-Flex data exchange is AMF or RTMP protocols. The open source AMF protocol is built on top of HTTP and it offers efficient data serialization between Flex and Java. RTMP offers faster socket-based full duplex communication.

If you install an open source server-side component BlazeDS under a servlet container of your choice, or will use Granite Data Services – AMF will be your only option for data transfer. Commercial LiveCycle Data Services ES (LCDS) will give you both RTMP and AMF implementations. LCDS will also offer you an automated way of data synchronization between Flex and Java.
There is a small number of high performing enterprise applications that would really benefit from using RTMP protocol, and beside using LCDS, an open source server Red5 may become the only alternative.

Note. RTMP protocol is also widely used for streaming video, but these applications are out of the scope of this article.

Challenges of Flex/Java enterprise projects

Let’s dissect a typical enterprise application that’s built with Flex on the client and Java on the server. If you are leading such a project, it’ll present the following tasks, needs, haves, and nice to haves:

1. Keep track of changes that the user makes via UI controls and send modified data to the server
2. It’ll have a number of views that will display the data in the form of grids
3. It’ll have a number of views that will contain forms
4. Some views will represent master-detail relations, i.e. selection of a row in a grid has to display the detail information in a form container.
5. The data grid columns will need custom item renderers ranging from centered checkboxes to dropdowns populated with some reference data by making a separate remote call to the server.
6. It would be nice if a form component could have its own data provider similar to the one that List-based controls use.
7. Data forms must be validated and it would be nice to have
a) reusable validators (i.e. two date fields should be able to reuse the same instance or the Validator object)
b) embedded validators, encapsulated in component such as DataGrid.
8. The main view of your application must appear on the user’s screen ASAP even if they have slow Internet connections.
9. The data changes made by one user may need to be automatically synchronized with the server and notification of the changes should be sent to other users potentially looking working with the same data set at the moment. This functionality is supported by Data Management Services in LCDS, but you may want to have the same functionality in open source BlazeDS.
10. If you are building an AIR/BlazeDS application, you need to come up with a custom solution for automatic data synchronization for occasionally connected applications.
11. Printing is an Achilles heel of Flex. You’d like to be able to generate PDF on the client for your Flex/BlazeDS or disconnected AIR applications.
12. Since your modularized application may consist of five-ten-fifteen Flash Builder projects, writing build scripts becomes a project in its own. Can writing script be automated?
13. Your Flex project may need to consume a dozen or more of Java data transfer objects hence you need to develop the same number of ActionScript classes for efficient data serialization. During the project development cycle the structure of these DTOs may change if not daily, then weekly. An automation tool for generation of DTOs can save you some project development time.
14. Some of the views in your application represent CRUD functionality and using code generators or wizards that lower the amount of manual coding is highly desirable.
15. How do I link all these libraries – RSL/Merge-in/External? Should I use Flex SDK as RSL?

Over the years, we at Farata Systems came up with our solutions to all of the items from the above laundry list. At this point every other reader would exclaim, “Finally, here comes the selling part. I knew it!”
Wrong! All of the components implementing the above functionality not only are available for free, but we also open sourced them as Clear Toolkit framework and (see SourceForge at https://sourceforge.net/projects/cleartoolkit/ ).
Now I will write yet another list of solutions that you might want to research further. By the way, even though we call our components a framework, you can use most of them ala cart.

How we deal with challenges of Flex/Java enterprise projects

We’ve created and are happy to share with the community a number of handy classes, tools, and techniques. You can get the code, which has been open sourced, and you can read our books and articles describing how to use them.

I’ll give you quick references that help in finding solutions to the above challenges (I’ll keep the same order and numbering).

1. Clear Toolkit has a library clear.swc, which has a component DataCollection that supports automatic tracking of the user changes. Look at the ChangeObject class – we’ve implemented it similarly to the one in LCDS, but ours can be used with BlazeDS too. If you need to make your updates transactional, use the BatchService class.
2. We use DataCollection (a subclass of ArrayCollection) as a data provider for data grids. Besides keeping tracks of changes, it encapsulates Flex remoting and reduces the amount of manual coding.
3. Research the DataForm component. Read about it in the sample chapter mentioned at the end of this article.
4. DataCollection supports proper updates in Master-Detail scenarios (see http://flexblog.faratasystems.com/?p=407).
5. Read about resources in the sample chapter mentioned at the end of this article.
6. Read about DataForm component in the sample chapter mentioned at the end of this article.
7. Read about Validator component in the sample chapter mentioned at the end of this article.
8. Read about custom preloaders and how to build every application as a mini-portal with a light-weight starting application in Chapter 8 of the upcoming O’Reilly book.
9. Read about DataCollection in general and hierarchical data collections with deep data synchronization in particular (http://flexblog.faratasystems.com/?p=407)
10. Read about the OfflineDataCollection (Chapter 9 of the upcoming book) and see a pre-recorded demo of a sample application that’s using it (http://flexblog.faratasystems.com/?p=394 ).
11. Explore the Clear Toolkit’s package com.farata.printing – it includes extended Flex components that can expose themselves in a format suitable for PDF generation. Read chapter 11 of the upcoming book for more details and samples.
12. An approach and techniques of minimizing the download time is described in Chapter 8 of the upcoming book.
13. Explore our DTO2Fx code generator that comes with Clear Toolikt: https://sourceforge.net/projects/cleartoolkit/files/
14. Read about Clear Data Builder 3.1 that can generate the entire CRUD application based on either SQL or arbitrary Java DTO’s at https://sourceforge.net/projects/cleartoolkit/files/
15. Read chapters 7 and 8 about linking libraries and loading modules in Flex RIA.

Where can I learn more about these solutions?

First, you can read the book Rich Internet Applications (http://riabook.com/) with Adobe Flex and Java that I co-authored with Anatole and Victor, my colleagues at Farata.
Second, you should read an upcoming O’Reilly book Enterprise development with Flex, written by the same authors.
Third, you may explore the source code of Clear Toolkit components and use the tools published at SourceForge.
Fourth, we invite you to enroll in Advanced Flex trainings, seminars and symposiums that we run on a regular basis. During these events we demonstrate most of the techniques mentioned above as well as our latest findings. Find the up-to-date information about such events under the Training section at http://faratasystems.com/
Fifth, read our blog at http://flexblog.faratasystems.com
To get a better feeling about the functionality of some of the extended Flex components, please read the sample chapter of the upcoming book Enterprise development with Flex. O’Reilly decided to publish this chapter as a three-part blog under my name, but I was only one of three co-authors, and all of us are accountable for these texts. Read the sample chapter here:
Part 1. http://www.insideria.com/2009/05/chapter-preview-building-an-en.html
Part 2. http://www.insideria.com/2009/05/building-an-enterprise-framewo.html
Part 3. http://www.insideria.com/2009/05/building-an-enterprise-framewo-1.html

Summary

I just want to give a full credit to my colleagues, excellent software engineers at Farata that work day in and day out on enhancing the functionality of Flex components and decreasing the amount of manual coding required by application programmers. Open sourcing our component have allowed us to bring more people to testing (our big thanks to people who use Clear Toolkit and report issues and make suggestions at Source Forge forums).

We invite Fle and Java developers to become active contributors and submit their version of enhanced components to make Clear Toolkit, a real platform for all who value open source solutions. There are no geniuses that can beat the collective intelligence!

Yakov Fain

Comments (8)