Archive for February, 2009

Grey Line

On Tuesday evening, I’ll be buying beer for every attendee after our workshop for Flex architects: http://www.eventbrite.com/event/247789144 .  To get $300 off the price, enter the discount code adjusting2crisis.

If you can’t make it in New York City, we’ll be running this event in Boston, MA on May 11 and 12: http://www.eventbrite.com/event/295389518

To the best of my knowledge, such advanced public training is not offered by any other RIA company.

Let’s have a beer together!
Yakov Fain

Comments

 

Grey Line

We started the process of open sourcing of our Clear Toolkit framework for developing enterprise Rich Internet Applications with Adobe Flex and Java.  The source code is located in the Sourceforge CVS repository at  http://sourceforge.net/projects/cleartoolkit/ . The current documentation, demos, user forums, and bug trackers are also there.

Clear Toolkit 3.1 includes the following Eclipse plugins and components:

Clear Data Builder 3.1 is an Eclipse plugin that allows to generate CRUD applications for BlazeDS or LCDS based on either an SQL statement or a Java data transfer object.

DTO2Fx
is a utility that automatically generates proper ActionScript classes based on their Java peers.

Log4Fx is an Eclipse plugin built on top of Flex logging API, but it automates and makes the logging process more flexible and user friendly.

Fx2Ant is a generator of optimized ANT build scripts for your Flex Builder projects.

clear.swc is an enhanced Flex component library. The source code of all components is located in the package com.farata.components.

Clear Toolkit roadmap includes the following enhancements this year:

1. Offer data synchronization solution for AIR/BlaseDS applications - February 2009
2. Enhance Flex UI component to support PDF generation on the client – April 2009
3. Offer a solution for Flex-based portals – May 2009
4 Document classes from our component library (clear.swc) – June 2009.

All these components were (and still are) offered for free at http://www.myflex.org but now we are inviting developers from around the world to join us in making Clear Toolkit the open source platform of choice for all Flex developers

Yakov Fain

Comments

 

Grey Line

I work for a company called Farata Systems. Laura is our office manager, and she doesn’t know Java. Everyone else does.  We work in the enterprise RIA space using Adobe Flex as a main development tool for creating all these Web pages connecting to the server side applications written in Java.

In December of 2008, Sun Microsystems has released the first version of a language for developing UI for RIA. I’ve been watching the evolution of JavaFX from its announcement at JavaOne 2007 till its release, but wasn’t able to find any demos that would prove that this extension of Java platform can be considered as a candidate for boring needs of enterprise applications. Watching demos like a bunch of balls moving inside a glass didn’t look too convincing to me.

We decided to contribute to Java community and invest some time and resources to figure out what JavaFX 1.0 is capable of. Most of the Java developers know what Pet Store application is. For many years this reference implementation has been used by Sun Microsystems as a part of Java BluePrints program for Java EE platform.

The current version of this application is described in the article called “Introducing the Java Pet Store 2.0 Application” that’s available at http://java.sun.com/developer/technicalArticles/J2EE/petstore/.

We re-used the existing back end of the Pet store, but performed a little facelift by replacing the UI developed with AJAX/JSP/JavaServer Faces with JavaFX 1.0.

I was working on this project with our senior Java developer Alex Litskevich who’s done lots of digging and research trying to find the best solutions whenever we would run into limitations of JavaFX.
The goal of this introductory article is to demo the JavaFX Pet Store. You can watch a quick prerecorded demo at http://myflex.org/demos/petstore/petstore.html .

In the future, I’ll deploy this application in one of our public servers and will review the code.

Last year, while attending a conference in India, I met an excellent Sun’s software engineer Greg Murray, one of the authors of the idea of Pet Store application.   Greg, I hope you’ll like this version of your pet store.

Flex, JavaFX, Silverlight…

I’ll be honest with you, during development of this application in the back of my mind I’ve been constantly comparing the way things are done in JavaFX with how I’d do the same with Adobe Flex.
Simply put, today, Flex is a lot more productive than JavaFX.  But let’s remember that we are comparing products of versions 3 vs. version 1. If you know how to develop Swing applications, you might want to continue doing this rather than manually creating JavaFX 1.0 wrappers for Java code as we did in our Pet Store.

The biggest issue is that JavaFX 1.0 doesn’t include any UI component library that a Web developer needs. I’m not talking about data grids or tree views. Even such simple things as a hyperlink component aren’t there. I can’t think of any other reason but a trivial lack of time and limited human resources allocated by Sun for development of this new UI set.

Hopefully, Sun will release a JavaFX 2.0 in foreseeable future with a full set of UI components, containers, navigators, and layouts. Just to draw an analogy, Microsoft has released absolutely naked Silverlight 1.0 in 2007, but full featured Silverlight 2.0 became available a year after.
The good news is that Java developers have already started building their own open source components for JavaFX. The name of this project is jfxtras .

On the other hand, I see some features available for JavaFX developers that are missing in Flex.

For example, ActionScript doesn’t support multi-threading. This is not an issue when it comes to communication with remote sites – all remote calls are asynchronous and use callbacks for server-to-client data flows. But if you’d need to write or use an existing Java library that performs some CPU-intensive calculations on the client, I’m sure Java will beat ActionScript.  The syntax of both languages is pretty similar though (see http://flexblog.faratasystems.com/?p=115).
JavaFX supports eval() function that allows to compile and execute a piece of code on the fly. Flex doesn’t  support this useful feature.

Two-way binding already exists in JavaFX but in Flex will get it only in version 4.

I’ve yet to see some benchmarks comparing Flex and JavaFX network protocol.  The latter just offers XML and REST for data exchange between client and server.  Of course, you can program Java sockets or wrap up an RMI client into JavaFX – would it be faster than ActionScript Real-Time Messaging Protocol? We don’t know. Or take HTTP tunneling between   Java Applet and a server-side Java stream. Would it be faster than using AMF, an HTTP-based binary protocol? We don’t know yet.

JavaFX removes a lot of complications in developing mobile applications. It promises to remove the need of using Java SE for desktop and Java ME for mobile – JavaFX should be the only solution you need. JavaFX Mobile offers hardware acceleration.  Keep in mind, there are 2.6 billion of Java enabled mobile devices! JavaFX has serious advantage in this domain over Flash Lite.

JavaFX 1.1 is about to be released. It offers performance improvements, bug fixes, new features in the mobile space, but no major additions to the desktop platform.

I understand that this is not a good time to ask for some serious cash injections, but if executives of Sun Microsystems won’t find a way to double the size of the team working on the future version of JavaFX, entire Adobe Flex team can safely go on sabbatical for a year.  If the money is tight, the sooner JavaFX will go open source, the better.

Even though I wouldn’t start developing with JavaFX a project that needs to go in production this year, overall, JavaFX looks promising. Try it out and see for yourself.

Yakov Fain

Comments

 

Grey Line

One of the main selling points of Adobe AIR is its ability to support occasionally connected applications. Imagine a salesman on the road working with an application without having a network connection.  As an example, this can be  a salesman of a pharmaceutical company visits medical offices offering their new pills called Xyzin.

While in doctor’s office, she uses an AIR application to take notes about this visit. The notes are saved in the local SQLite database that comes with AIR.  But as soon as the Internet connection becomes available (at Starbucks or at home), the local data get synchronized with a central database.

Adobe offers a data synchronization solution based on Data Management Services for those who own the licenses of LiveCycle Data Service.  But those application developers who use an open source BlazeDS don’t have any generic way of setting such data synchronization.

We came up with a such solution that will be included in the upcoming version 3.2 of our framework Clear Toolkit.

Watch the following screencast to see a demo application which shows such data synchronization in action: http://www.myflex.org/demos/PharmaAir/PharmaAir.html.

Yakov Fain

Comments (2)

 

Grey Line

During the next three months I’ll be making a number of technical presentations for Flex and Java developers. These are the confirmed events:
1.    New York Flex User’s Group, February 19, Flex design patterns, details should be available soon at http://nyflex.org
2.    Java developers conference in Atlanta, March 11 – a keynote on comparing technologies for rich Internet applications and a technical session on automatic code generation for CRUD RIA. Details at http://www.devnexus.com/
3.    Chicago Flex User’s Group, March 18, Flex design patterns, http://chicagoflex.org/
4.    Princeton Java User’s group, Developing Pet Store in JavaFX. I’ll schedule this meeting some time in March. Keep an eye on http://myflex.org/princetonjug
5.    Flex conference 360Flex, Indianapolis, IN, May 18-20, Design patterns: a Deep Dive: http://www.360flex.com
My colleague Victor and I will run a two-day public workshop for enterprise Flex architects in New York city on March 2-3, details are available at http://www.eventbrite.com/event/247789144 .   Readers of this blog will get $300 discount by entering a special code adjusting2crisis during registration.

That’s all for now.

Yakov Fain

http://twitter.com/yfain

Comments

 

Grey Line

You can check out the other great 49 speakers on the schedule at: http://360conferences.com/360flex/downloads/schedule.pdf It’s looking like it’s gonna be another great 360|Flex conference, especially with yours truly speaking.  Tickets are cheaper on a first come, first serve basis! So buy your tickets asap at http://360flex.eventbrite.com to get the best possible price. See you there and you better go to my session!

Yakov Fain

Comments

 

Grey Line

The rough cuts version of the first chapter of our book “Enterprise Development with Flex” is already available for subscribers of Safari Books Online .

The first published chapter is about the use of selected design patterns in Flex. This is not a tutorial, but rather a bunch of illustrations of why and how you can use some of the patterns in Flex. For example, everyone know what Singletons are for.  In this chapter you’ll see how you can use Flex Application object as a singleton storing your business objects. Yep, no need to clutter your code with tons of XYZ.getInstance() calls.

Or take an ObjectProxy class – you can easily use it as a wrapper to any other ActionScript class adding a new functionality to the class being wrapped even when you don’t have access to the source code of this class.

Mediator is my favorite design pattern for UI development with Flex.  A component A talks to a component B in a loosely-coupled manner via a mediator using custom events.

We’ve already submitted six chapters to O’Reilly, and hopefully more of the rough cuts will be published in February. In one of them we compare Flex frameworks, the other shows you how to extend Flex components to make them smarter, chapter 10 is about Flex portals, chapter 7 is about loaders and modularization, chapter 4 deals with BlazeDS and AMF, chapter 4 talks about a set of tools that an enterprise Flex team should consider.

My co-authors work on their chapters late at night, but I’m more productive during wee hours. In particular, this Saturday morning I’ve been working on the AIR chapter. It will include sample occasionally-connected application for the salesmen of the Acme Pharm company. You’ll see how to synchronize data between the local and remote databases via BlazeDS. Next week I’m planning to record a screencast showing this application in action.

I’ll finish up this brief post with an announcement for enterprise architects who somehow came to the conclusion that Adobe Flex is the right technology for development RIA. My colleague Victor and I will run a two-day workshop for application architects and development managers giving a compressed overview of the proper way of running Flex projects. This is a unique class that’s not offered anywhere else. The class will take place om March 2 and 3 in New York City, and the early bird price will expire in 5 days. Details at http://www.eventbrite.com/event/247789144

Yakov Fain

Comments