Archive for February, 2008

Grey Line

John and Tom produced the best 360Flex show up to date. Great location, sessions that are long enough to cover aspects ever expanding platform and great timing with Flex 3 release. Definetly the best Flex developers conference to go to.

This morning started with keynote by Adobe – obviously product announcement, but also detailed explanation of things going OS. You can not underestimate the importance of that step. It removes a lot of obstacles in wide adoption of Flex platform – both in developer and tool making communities. As a matter of fact, it makes almost impossible for anyone in toolmaking market not to provide open source version of their product now. So we will have few announcements to make about changes in pricing model ( how does FREEE sound ?) this week. 

My session had a late start – keynote was running late and projector would not connect to my MacBook Pro ( next time I will pack my trusted thinkpad along). Interesting enough, the questions asked after the session were from the slides I had not have time to go through. So I will run the same session on Wednesday, 2:30 – will go through the remaining slides, and I will also add a lot of stuff based on the questions asked. Bring or send the questions – I will make post show video with the sessions materials.

 

Oh well, time to go to another party….

File Attachment: 360flexAtlanta.ppt (1569 KB)

Comments

 

Grey Line

I always respected cliffhangers. Not because I want to become one, I just understand that it’s very difficult. Cliffhangers don’t try to make it look easy – they openly admit that it’s hard, but this is what they like.
In software development there are different lobbies. There is this guy, he’s very experienced .Net developer. When we see each other, he behaves very aggressively trying to convince me that what he can do in .Net I can’t do in Java.

Ruby on Rails people are ready to kill anyone who says anything against their baby.

But AJAX developers are different. They always openly state that AJAX is difficult, and I respect them for this. If you are thinking of using AJAX for your next enterprise project, I urge you to watch the video of the presentation by Joseph Smarr, the Chief Platform Architect at Plaxo, Inc., where he’s led the engineering of Plaxo’s address-book integration application.

Joseph is very experience AJAX developer, and if after watching this presentation you won’t get goose bumps, go ahead and start your next RIA project with AJAX. Make sure that you can afford to hire a team of developers of Joseph’s caliber.

I respect AJAX developers and will participate in the upcoming AJAXWorld conference next month in New York City.

Yakov Fain

Comments

 

Grey Line

If you had only one hour in Paris, what would you do?

I, for one, would walk around Notre-Dame, and the point I am going to make is about Flex:

If I could pass just one Flex advice that would be: Use Data Transfer Objects.

Use Data Transfer Objects and NOT the dynamic Objects, and NOT the XML to pass data between your server and Flash tiers. If you are working with a Java Server, make your Java (methods) accept/return custom classes and NOT Map objects.

With this keystone your architecture will be reliable and performing. You will save tons of time and energy. What do you do with these savings – none of my business.

Here are the details:

1. _DO_ define similar classes on Java and ActionScript. See details of Java/ActionScript type mapping in the Flex documentation.

2. _DO_ declare these classes as [Bindable] if you envision dynamic updates to the data. Further, _DO_ use collections of these Bindable instances as dataProviders for your DataGrid and let Flex do the miracle: all changes to the data will be reflected by the visual control. There are no miracles, of course: [Bindable] is a shortcut to dispatch event on a data change, the very same event that is expected by ArrayCollection. The collection in turn, dispatches a (different) event on its change. Importantly – the very same event that is expected by the DataGrid.

Let me put it another way: have you ever used collection.itemUpdated()? Well, once you start DTO’s “itemUpdated” will sound to you like the name of the undocumented event :)

OK, I will rub it in further: if you marshall (property) Array of Objects, the Array itself is Bindable, but none of the items are.

3. Make sure that your server-side and client-side DTOs _DO_ provide unique! set/get uuid property. Flex loves this property, do get in love with it too. Flex is using it to identify elements of data presented by the list-based controls. You will find numerous uses for it as well. For instance, instead of sorting by industry, ticker you would sort by industry, ticker and uuid. Why? Because then the hash value will be unique for each record, which would result in substantially better performance.

4. _DO NOT_ hunt for value change on the visual controls (aka View). This task belongs to the data layer (aka Model). Consider replacing [Bindable] public var with the get/set property pair and dispatching the event (PropertyChange) yourself:

private var _amount:Number;
public function get amount() : String{
return _amount;
}
public function set amount( value : Number ):void{
var oldValue:Object = this._amount;
if (oldValue !== value) {
this._amount = value;
dispatchUpdateEvent(“amount”, oldValue, value);
}
}
private function dispatchUpdateEvent(propertyName:String, oldValue:Object, value:Object):void {
dispatchEvent(
PropertyChangeEvent.createUpdateEvent(this, propertyName, oldValue, value)
); �
}

Then, to act on value change, consider customizing the set method. Better yet, consider extending your ActionScript DTO with another class: leave basic layer of DTOs untouched, do customization in the extension. One more gain right here: now you can intercept (breakpoint) whenever your data changes.

5. _DO_ use extension of DTO class (above) to introduce “computed columns”:

public function get unrealizedGain():Number {
return lastPrice – costBasis; �
}

Again, _DO NOT_ use itemEditEnd of the control for these and similar purposes.

_DO NOT_ be afraid of two [RemoteClass] pointing to the same Java DTO: Flex will resolve the reference in favor of the extension layer.

6. Over your project lifespan, you will see many additional fits for DTOs: custom serialization, custom toString() and toXML() methods.

Now, you may say that all these recommendation are way too obvious.

Then I just take off my hat and … see you around Notre-Dame, perhaps.
Otherwise, keep coding.

Victor

Comments

 

Grey Line

1. Flex 360, Atlanta, GA, Feb 25. Best practices, Anatole Tartakovsky

2. AjaxWorld, New York, NY, “Picking the Right Technology for Enterprise Rich Internet Applications, Yakov Fain

3. RIA with Adobe Flex, New York University, from April 3, Yakov Fain

4. Flex hands-on training, Weekend with Flex experts, Philadelphia, April 12-13, Yakov Fain

5. Flex on Wall Street, New York, April 18, Yakov Fain and Victor Rasputnis

6. Great Indian Developers Summit, May 21-23, Bangalore, India, Yakov Fain

7. Flex hands-on training, Weekend with Flex experts, Boston, May 24-25, Victor Rasputnis

8. Flex hands-on training, Weekend with Flex experts, Chicago, June 21-22, Yakov Fain

Note. Flex hands-on training sessions “Weekend With Flex Experts” have limited seating. Early registration is recommended.

Comments

 

Grey Line

OK, car manufactures go Flex. Will they lose or gain customers after that?

Car manufacturers want to have fancy consumer sites. It’s a RIA world, and having interactive Web sites should bring more people to car dealerships. Bikers to want to see nice looking Web sites. Check out Harley-Davidson’s Web site: http://www.harley-davidson.com . While most of Harley’s site is done in DHTML, go to Motorcycles menu, pick a model, get some pop-corn and enjoy the show. That piece was done in Flash. Isn’t it nice?
Let’s take another site for Mini cars: http://www.miniusa.com , which was also build in Flash and is delivered by Flash Player. It’s also not bad.

You can spot a weird-looking car on the roads. It’s called Scion. Their Web site looks a lot better than the car itself, isn’t it?

A recent addition to the RIA collection is UK’s Volkswagen. This one was done in Flex and was also delivered by Flash Player: http://www.volkswagen.co.uk/ . Excellent artwork – just take a look at how you can customize the wheels or the exterior paint color. Isn’t it something? But something else did not look right… The site was a bit slow, and I was on a fast 30 mbps connection. This got me thinking – the majority of the population will be connecting to this Volkswagen’s site via a lot slower connection lines. What their experience would be?

I decided to make an experiment. I have my cell phone with me that I can also use as a modem via the USB port of my laptop. Luckily, I was in the area of slow connection – www.speedtest.net reported the download speed of only 180kbps. Now we are talking! Welcome to the real world.
I went to this Volkswagen’s Web site and started to wait. During the first minute nothing happened –a white screen with a wait cursor. To make the long story short, I had to wait two minutes and forty five seconds till I was able to use the site. Don’t you this it’s a little too much?

I’d guess that about 25% of people who visit Volkswagen are impulse buyers. They did not open the site because they were really interested in buying specifically Volkswagen. After one minute wait, they’ll abandon this site and go to Volkswagen’s competitors. Does Volkswagen is ready to lose these customers just because they were using cool Flex technology? I don’t think so.

Each RIA project has at least two groups of people involved – designers/artists, and people who know how to program.I know this first hand, because I currently work on a Flex project for yet another large car manufacturer. These applications have a lot of art. Can’t change it, they (creative people) know how to sell. Fine, but it’s good to have people who know how to efficiently program rich Internet applications.In case of Volkswagen, my hat off to creative people and my boo to their application programmers.I’m afraid that poorly programmed RIA will hurt Flex. Volkswagen, do some stress testing and optimize your web site!

Yakov Fain

Comments (8)

 

Grey Line

This week I’m teaching Adobe Flex class to a group of Java developers of a Wall Street company.  After 9/11 many organizations moved from Manhattan across the Hudson river to Jersey City, NJ.

Jersey City is a high crime city, but now the narrow area of 2-3 blocks from the river has been rebuilt, with new office and apartment  buildings and with a simple train commute from Manhattan.
FlexOnHudson

I took this photo shot right in the classroom. How do you like this view from a student’ desk? This is not a wallpaper, but a view of the downtown Manhattan.  You’d have to be a big shot to get an office with such a view.  The other option is to be a student.

Comments (1)

 

Grey Line

Flex bug database is available at http://bugs.adobe.com/flex/

I have a strong feeling that I’m about to enter the same waters again… When the Flex open source announcement was made, one engineer from Flex team has asked me if I had any suggestions in this regard. I told him about the bitter taste that Java’s bug parade has left in my mouse. People were allowed to vote for bugs, but some of the top voted bugs were sitting in the database for 7(!) years. What are the guarantees that it won’t happen again with Flex? 

The Flex Bugs FAQ has the following:

“Does my bug report immediately go to the development team?
No, A Bug reports only get reviewed by the development team once it receives support (votes) from others in the community.”

I do not like this answer. Been there. Done that. Do not want to do it again. I remain cautiously optimistic that Flex team will be more responsive than their Java colleagues. The time will show.

Yakov Fain

Comments (2)

 

Grey Line

First, let me explain how Flex deals with Date transfer. Dates are transfered to/from Flex client as UTC date – no timezone information available. Transfer to the UTC/local time happens automatically on protocol level. As a result, if the server does not know client’s timezone, it can not derive the entered time – rather it operates on Global time only. It means that if I am on the East coast and entered 1PM, person in Denver will see 11AM.
Depending on the type of application it can be desirable behavior – however in most of the applications it is not. Sometimes I want to enter time in the client’s local time – regardless of the timezone I am in at the time of data entry. It means that application has to operate without timezone – or for that matter in one timezone. Usually it is solved either on the server side by keeping client timezone information in session and adjusting dates on each transfer or by communicating date as String. In either case it requires a lot of code and constant tracking of the issue.

However, it can be solved much easier with usage of transient tag/keyword during data transfer:

AS3:

package com.farata.datasource.dto
{
import flash.events.EventDispatcher;
[RemoteClass(alias="com.farata.datasource.dto.LineItemDTO")]
[Bindable(event="propertyChange")]
public dynamic class LineItemDTO extends EventDispatcher //implements IManaged
{

private var _myDate : Date;

public function get myDateUTC() : Date{
return _myDate ==null?null:new Date(_myDate.valueOf() – _myDate.getTimezoneOffset()*60000);
}
public function set myDateUTC( value : Date ):void{
var oldValue:Object = _myDate;
if (oldValue !== value) {
this._myDate = value == null?null:new Date(value.valueOf() + value.getTimezoneOffset()*60000);
}
}
[Transient]

public function get myDate() : Date{
return _myDate;
}
public function set myDate( value : Date ):void{
var oldValue:Object = this._myDate;
if (oldValue !== value) {
this._myDate = value;
dispatchUpdateEvent(“myDate”, oldValue, value);
}
}

Java:
package com.farata.datasource.dto;

import java.io.Serializable;
import java.util.*;

public class LineItemDTO implements Serializable
{

transient public java.util.Date myDate;
public java.util.Date getMyDateUTC()
{
return myDate;
}

public void setMyDateUTC(java.util.Date value)
{
this.myDate = value;
}
}

That is all – you have normal public variables on both sides, and serialization works transparently, keeping Date in UTC zone on both sides (you also need to set JAVA VM timezonne to UTC) – and now you are always in the servers timezone.

Enjoy,
Anatole Tartakovsky

PS Please evaluate your need for local vs global time – otherwise you would have cases like Dell’s support center in India when they were asking for feedback on service 8 hours before it was suppose to happen – I once got a call @ 2AM about delivery set up for 10AM – plan carefully.

Comments (1)

 

Grey Line

Adobe Flex enterprise market picks up really fast, and it’s obvious that the need of in Flex developers will only get bigger and bigger. The question is what kind of Flex developers are in huge demand. I’ll share with you the experience of our company (Farata Systems), but first, let’s look at the diagram from the popular job aggregator indeed.com.

I’ve entered Flex Java and Adobe Flex as my search criteria for the Indeed’s trends analyzer, and as you can see the need for developers with just Flex skills grew six times since Flex 2 has been released in June of 2006. The need of people with Flex and Java skills has also tripled.

In a recent editorial I’ve described three types of Flex developers on a typical enterprise project. This time, I’ll share with you a typical start of a new project based on our real world Flex consulting experience.

One way or the other, a firm XYZ realizes that the only practical way of creating their next version of the rich Internet application is Flex, and I assume that you (the project manager) are already sold on this. And what’s the next step? Quick look at the labor pool of Flex developers may depress you – the unemployment rate among Flex developers is close to zero. What makes things worse, these people can afford doing only the cool stuff, and some of them are not that interested in developing boring enterprise systems. Can’t blame them.

Pretty soon, you (the disappointed manager) realize that the only way to make your project successful is to re-train your own developers. In February alone, our company was invited to run 3 (!) certified Flex trainings for different enterprise clients. Our typical student is a Java developer, which after five days of intensive training turns into… a junior Flex developer.

You (the seasoned program manager) realize, that even though your people are proven commodities and have successfully completed challenging Java projects in the past, starting this highly visible Flex/Java project without a mentor is a risky endeavor, and you start looking for a team lead just to find out that it’s not an easy job to do.

Our company has only senior Flex developers, and we started to spread ourselves thin between the clients – two days a week our mentors work for one client and three for another, and this model seem to be working well for both parties. After attending the training, your own people can start working on the project given the part-time support and guidance of someone who has a number of Flex projects behind his belt.

That’s the reality, and if you (the smart project manager) can’t find the full time front man for your Flex project, try to get a piece of him. Can’t get him for a two days, get for one. Can’t get for one day, get for half. We started practicing so called blended resources and pay rates. Such a Flex resource (sorry for this inhuman term) can consist of a 30% of a local Flex expert and 70% of the senior (!) developer working remotely. There kinds of arrangements are almost non-existent is such well established markets as Java or .Net, but you (an aggressive and innovative project manager) should think out of the box and try to find solutions that will help you to get things done.

Sorry for the cold-blooded coverage of the situation with the enterprise Flex labor force, but this may help you in finding a solution for your today’s challenges as opposed to reading multiple articles and blog posts that just proclaim that the Flex job market is great. It’s great, but today it’s the seller’s market, while you may be a buyer.

Yakov Fain

Comments (1)

 

Grey Line

Action Message Format (AMF) is a protocol that is used to serialize the data coming into Flash Player or going out to other programming environments that need to communicate with Flash Player. Say, if you create in Java an instance of the class MyOrder.java, this instance can be converted into a string of bytes, sent over the wire to Flash Player and then recreated there as an instance of the ActionScript object MyOrder.as. The rules of how to do this are defined by a communication protocol, such as AMF. Prior to Flash Player 9, the protocol AMF0 has been used, but now Adobe offer implementation of more efficient AMF3.

The good news is that Adobe decided to make the AMF3 protocol available to the public, and you can find its description in this document.
This is great news for Flash community as it’ll allow more and more third parties to implement this protocol and offer a lot faster communication between the Flash Player and programming environments written in other languages. While Adobe today offers its own implementation of this protocol for Java and Coldfusion, now it’ll start competing with other firms that may offer more efficient implementation of this protocol or better tool for developers. The Midnight Coders is one of the vendors that are offering their version of AMF for Java, .Net and other platforms.

While the AMF uses HTTP as a transport, the speed of data exchange between Flash Player and, say, J2EE application over AMF would be at least ten time faster than comparing to a regular HTTP protocol.
AMF protocol is based on data polling, but Adobe offers yet another Real Time Messaging Protocol (RTMP) that is being used in such applications as video streaming or others where the real-time push from the server is needed, for example financial trading applications. The specification of RTMP protocols has not been published yet at this point.

Yakov Fain

Comments