Javapolis 2006 – Building Sexy Web apps with Flex

Last year I attended
the Flex presentation by Waldo Smeets and played with the beta. I even gave a
presentation and workshop about Flex at Amis, so there was not really a reason
to attends this years presentation by James Ward and Christoph Rooms. But I
like Flex very much and I wanted to write this blog, so some fresh information
was welcome. Also Flex 2.0 got released this year and I was interested in the
development of Apollo.

When I try to explain
people what Flex is about I almost always have to explain that it is not about
flashy movies, banners or irritating intro’s for websites. It is a application
framework to create interactive web applications. When you compare it with
‘normal’ web development it is best to compare it with XHTML and javascript and
some server technology to connect to a back office system. When creating a Flex
application you write an MXML file (the first M stands for Macromedia, the
company that invented Flash and Flex and was acquired by Adobe) and
actionscript to it. Actionscript is very much like javascript: the both have
ecmascript as parent. The servertechnology can be almost everything, Flex
applications can talk directly to java applications, databases or through
webservices to virtually every technology.

That’s al technical.
But Flex is more about experience. It just looks great! After svery
presentation I see people leaving the room in awe. Applications operate smooth
and fast It is hard to describe. You should see for yourself. A great example
of what is possible is available at:


The greatest
disadvantage is that it uses a plugin. That’s what most people think. I see it
as advantage. The flash player is the most consistent and most widely spread web
platform that is available. Microsoft’s IE is less spread than the flash
player. If you don’t have it, installing is a breeze. It is even smaller than
the most javascript code you need for an Ajax
framework to achieve the same effects.

It is not the best
solution for every situation. For example when you’re creating a website with a
lot of text and some interactivity: use html with Ajax. Flex is just not well suited for
displaying large chunks of text. It is more suited when you are creating an
application for the web or you have to include movies for example. It is
possible to use them both. Adobe has created an Ajax-Flex bridge to combine
these technologies.

One of the new
developments I’m interested in is Apollo. This makes it possible to run your
web apps on the desktop, outside your browser. Not only Flex applications but
also HTML and Javascript can run in this virtual machine. To run these
applications Adobe has a scripting engine and has donated this to the
Mozilla-Tamarin project. The expectation is that this engine will part of
future releases of Firefox, but not until 2008.

To connect to
databases or other applications you need Flex data services. This is a JEE
application that can be deployed in many application servers. It is very easy
to use datasources in the client. Just a few Lines of code and you can call a
dataservice and bind that to a grid or something. It works similar as
databinding in .Net

An interesting feature
is auto commit. This means that when you change the data in the application it
is automatically saved in the backend. Next to this there is also a cool auto
update feature. When data is changed in one client another client using the
same date receives the update instantly. It pushes the change to the client! No
extra programming is needed for this, it’s just a property of the datasource.

To connect to
databases you can use many different technologies, for example Hibernate.

Flex applications can
be created completely free of cost, you don’t need the Flex Builder. You can
just write your mxml files in notepad and compile them in swf files with the
free SDK. Data services and components to create graphs also cost money, but
you can use the data services for development and small systems for free.

As you might have understood by now I’m very enthusiastic about Flex. It’s not because I got a free t-shirt. I really think this is a very good platform to build interactive web applications with.


  1. Rob Janssen December 18, 2006
  2. Arjaan Peree December 16, 2006
  3. Waldo Smeets - Adobe December 14, 2006