logo

An Introduction to Flex

Over the new year break I discovered Adobe Flex and have fallen for it, big time. Although I knew of it's existence before, I'd kind of written it off as being "just Flash". Now I can't believe I went this long without taking the time to find out more. Although it is "just Flash" it's an amazing tool that I can't encourage you enough to take a look at.

Don't worry, developing in Flex is nothing like developing in Flash. If you've tried creating Flash movies you'll know what hard work that is. With Flex it's much easier and there are many parallels with usual HTML-based web development. The learning curve isn't very steep at all. More of a gentle slope.

What is Flex?

It's a way of creating Rich Internet Applications (RIAs), which are based on Flash and so packaged inside a single SWF file. You embed this file on your webpage - like a normal Flash "movie" - and there you have it - a "rich internet application".

Here's an example - a "document explorer" I've been playing with which lets you find certain documents from within the Dext database. Click the image to take a look.

 flexapp

Like the accounts interface I mentioned the other day it's not so much a useful application as it is a way of me getting to learn the ins and outs of Flex. What you see though didn't take long at all.

Is it the Future of the Web?

No. As I see it Flex is only really useful when creating applications. If you want to create a typical website, such as a forum, blog or other heavily text-based site (that you want Google to index) then HTML is still the only answer. If, however, what you're building is more like a typical desktop-based application then maybe Flex could make building it on the web a whole lot simpler. As ever it's horses for courses.

For every project I've worked on recently where I can see Flex might have worked I can think of at least one other where it wouldn't have.

When It Comes In Handy

My interest in Flex came about as I am currently tendering for a couple of projects where the systems are required merely to "report" on data in a database. In one case the client wants nothing more than a web-based interface to view what data is held. The interface then need to allow further sorting/filtering of the data. Custom view-building if you will. Flex is a perfect fit.

Trying to design an HTML-based layout and interface (from scratch) can take way too long and be a nightmare to make it cross-browser. That's before you get as far as choosing the JavaScript framework to use or go about finding the most suitable plugins to add - such as, say, a date picker. When you do find those plugins you then need to extract all the files and carefully add them to your project. As you must know by now web development can be a chore at times.

With Flex developing it becomes a pleasure again. You do it all from with Adobe's Flex Builder app. You can either code by hand or use drag and drop to place elements on the work area in a WYSIWYG manner. Most of what you need comes as standard so you don't need to choose additional plugins or worry about where to put the myriad files that accompany them.

Can Anybody Use It?

More or less, yes. To use a Flex RIA you'll need Flash Player version 9 or later. Looking at the stats for codestore.net it looks like 90-something % of you do. Whether this is an issue or not depends on who your user-base are.

In most cases, for web-based applications that suit Flex, I'd imagine it's a corporate environment and you know they should have it or can insist they get it if not.

What About Accessibility?

I could be wrong but, like Flash, I imagine Flex is inaccessible. If this is an issue then Flex probably isn't for you.

Is it better than Ext?

Flex and Ext are very similar. They do a lot of the same things out of the box. Personally though I've not found Ext that much fun to develop with. You need a first class degree in JavaScript to get the most out of it. Most of us (myself included) only have a second class degree. I find Ext messy and almost cumbersome. Flex feels much cleaner. I know which I'd rather use.

Ext, however, is probably a better fit for Domino. Ext allows you to embed an iFrame with a standard Domino page/form in it. You can create/edit/save documents without needing to do much to the form at all. With Flex it's a different story. You have to create the whole form in Flex code and make sure the names match with the backend form. Any new fields on the Notes form would mean recompiling and uploading a new SWF after having added the new field in Flex.

Further Reading

There are plenty of example Flex applications out there to get you excited. Start with the Flex Showcase. If that doesn't work for you take a look at the Flex Component Explorer or the samples tab of Flex Developer Center -- such as this dashboard app.

Here's a video of somebody building a simple Flex app so you can see what's involved. My next post will show the basics of plugging a Flex app in to a Domino database.

Comments

  1. Flex is definitely an interesting technology. I've only really found myself tacking in flash for small specific uses though, as I tend to run into too many limitations.

    Also I would agree that the learning curve on Ext as of now is a bit steep. Though we are working to try and simplify things more and working on some more newcomer friendly help/documentation for the next release.

  2. Flex/Air is tough to beat for web application development. The only real complaint I've heard about it is that it's slow when working with large datasets. It solves so many browser UI problems that anything else seems like a waste of time. Microsoft Silverlight is playing in the same space and is catching up fast. Where does this leave Domino? Even with XPages we're still a step behind the industry. Hopefully we'll see more articles like this on Flex/Domino integration in 2009.

    Thanks for the timely article Jake!

    • avatar
    • smak
    • Tue 13 Jan 2009 09:28 AM

    >> "What About Accessibility?"

    http://www.adobe.com/accessibility/products/flex/overview.html

    I have not actually tested this but there appears to be some accessibility.

    -smak

    • avatar
    • Jonathon
    • Tue 13 Jan 2009 09:36 AM

    Jake, I have to say I'm just like you. I've been putting off learning flex, but reading your post today, I think I'm going to make that one of my goals this year. Especially keeping RAD in mind, this seems like a great platform for getting simple easy to use apps together quickly.

    Great post!

  3. Saw something like this a few years ago when I was exploring frameworks called OpenLaszlo (http://www.openlaszlo.org/). Seems kinda simliar -- just never liked the "closed" nature of Flash stuff. Plus, flash performance on Linux has always been sketchy, at best (hurts my development environment!). Gotta admit it looks always looks smooth and clean, though.

    And "You have to create the whole form in Flex code and make sure the names match with the backend form." Eh? I do that in Ext just for the fun of it. :P

    • avatar
    • Ben
    • Tue 13 Jan 2009 05:34 PM

    More info on accessibility here: http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_04.html

    Haven't looked into it yet though.

    One thing that seems to go unmentioned (I didn't know for ages) is that Flex is actually Open Source software. The compiler (and the code behind it, and all the flex libraries) are freely available.

    Of course the Flex Builder Eclipse plugin makes development much, much easier.

    Ben

  4. Got to speak up for Rich and the boys here Jake.

    Just scratched the surface with Flex since your post, but I'm a big fan of Ext.

    B1R1 was a quantum leap, especially the handling and display of categorised views. Looking forward to the next Ext release....it does get easier as time goes on. The initial release was mind-boggling!

    It isn't easy, I've invested a lot of time in it, but very happy that I have.

    Really looking forward to your series on flex. I plan to use both technologies.

    The loser for me at the mo is dojo. Had a go, but didn't like.

    Am I wrong here?

    rgds

    nick

    • avatar
    • Jake Howlett
    • Wed 14 Jan 2009 03:23 AM

    You're a big fan of Ext or Ext.nd Nick?

    I was only really talking about Ext itself. I have great respect for what they've done with Ext.nd, but if you need to extend Ext.nd then you better get your advanced JavaScript hat on and bring a bucketful of patience with you.

  5. Touche!...

    Yeah good point, ext.nd Jake. I wouldn't know where to start with raw ext.

    Actually, if you think outside the framework with ext.nd and use a lot of tricks (many of which you invented BTW), ext.nd is quite a forgiving thingumy.

    I've even integrated it into horrible sharepoint, no problems at all.

    Almost fell off my chair when it worked!!

  6. Something that worries me are the file sizes created by Flex.

    I tried to create a basic example and ended up with a 1.5MB download...

    I'm not sure how well this would scale to a medium/large Domino application. Maybe there are load deferring techniques or perhaps this initial footprint is high and as you add components it doesn't get much larger.

    I guess if you are inside an Intranet that's less of a concern. In my case, I have clients that would access those Flex apps over the net, so I am kind of relutant in adopting it .

    • avatar
    • Jake Howlett
    • Wed 14 Jan 2009 08:10 AM

    I've not seen Flex create an SWF file over 600kb yet Eduardo. How basic was your example? Did you embed images in it?

    • avatar
    • Sagar
    • Wed 14 Jan 2009 09:38 AM

    Jake,

    Its easy to get a report functionality up and running with flex using grid. But printable format is a challenge. The default grid doesn't print well.

  7. Good article.

    I've been playing with Flex for a while now and have been very impressed with the power of it and how easy it is to build RIAst (ActionScript also shows just what JavaScript could be ...). I'd always thought that it would be a good fit with Domino, but until recently I hadn't had a real world opportunity to try this out. Then at the end of last year I had a project that required a reporting front end for a Domino application and after some consideration of the options we opted for Flex. Development was amazingly quick and the end results were very well received by the client. Integration with Domino was achieved easily by using the HTTPservice component and a number of views that were marked up as XML. All very simple stuff.

    In addition to standard charts and lists, one requirement was to have a geographic selection, so that users could filter results by clicking countries on a map and display data on the map. To achieve this I opted for the iLog Elixir components (http://www.ilog.com/products/ilogelixir/) and the end result was similar (in functionality, with the addition of lists and i used Flex components for the charts) to this example:

    http://blogs.ilog.com/elixir/2008/03/25/advanced-dashboard-with-ilog-elixir-the-world-factbook/

    (N.B. I noticed the other day that iLog was recently bought by IBM. Probably for the other reporting tools, but it would be nice to think that IBM was considering tighter integration of Domino and Flex)

    As you say, Flex is not a replacement for standards based web development, but in some situations, reporting being one of them, it's a great solution and easily integrates with Domino. Not having to worry about whether it will run in a particular browser is great, esp with a complicated interface.

    To answer one of the other queries that arose above, my particular swf was just 650K. Still quite large for an internet app, but fine for an intranet app, which this project was.

    As far as I am aware, the accessibility issues that were a problem with early Flash have now been addressed in the latest versions of Flash and Flex, but I've not really tested any of this.

    My main concern with Flex is performance with large data sets. The data set for this project was only about 1000 documents, but the XML file was about 1Mb, so quite large. Flex was just about OK with this. That said, I think that a lot of work could have been done to improve the performance of the code. I think that e4x probably has a lot to offer to improve the performance and that is the area I plan to look at with the next release.

    Good luck with the Flex projects. If you need any more info to help win your tenders and justify Flex as an option, please drop me a line.

    Finally, have you seen this site: http://flexdomino.net/home

    Still early days, but there is some good ideas there.

    Cheers

    Alan

    P.S. One final prob with Flex is that going back to JavaScript after ActionScript is very painful :-)

  8. Thanks for pushing the bar again Jake. :-) I've been working on a web app lately and have been taking care to create it so I can slip on a flex interface easily when I have time. Hopefully that time will come soon. Sooner now that you've broken out ahead of the pack with demos and all!

  9. Hi Jake,

    If you visit the open source sample at:

    http://www.flexdomino.net:40080/flex/flexdbloc.nsf/$about

    You'll see that the SWF file is a 2MB download. It seems to be a pretty basic UI, with a lot of views and an outline, but hardly any forms or business logic.

    As I said before, maybe it's not a big deal for an Intranet app but it takes many seconds to download over the Internet using a standard connection. I guess the download performance is even worse because SWF seems to be a highly compressed format, so even Gzip won't do it any good.

    By the way, congratulations on the new Accounts.nsf demo ! It's turning out really nice.

    • avatar
    • Niel R
    • Sat 7 Mar 2009 08:51 PM

    Jake-

    Thanks for the intro to flex, great stuff as always. Have you seen any way to implement the BlazeDS server on a Domino server?

  10. Not an expert on Flex, but I've been doing some research.

    I'd be using for actual applications (not dashboard reporting, for instance). If you are doing an actual applications that would normally be multiple screens for different elements of the application is that possible in Flex?

    I've been hitting on things on the edge of my research that this might not be the case (and certainly non of the examples do this)?

    • avatar
    • Jake Howlett
    • Fri 13 Mar 2009 02:46 AM

    Hi Ian,

    If you're after my own opinion (or that of others here) as to whether it's the way to go you'll need to describe the app in more detail (at least for me).

    Jake

  11. There is no app specifically, it's more trying to assess Flex's potential limited. So, let's go with an example.

    In a typical web or windows application you'll have numerous screen / pages for viewing / editing data. It's a typical client / server sort of deal, with screens for each particular business object (in this case I don't necessarily mean a technical object). So, you might have a screen for vessels, projects, port calls, purchase orders, etc. Some of those screens may be composites - Port Calls having Purchase Orders, for instance.

    As I say, a generic example, not necessarily something I'm doing.

    It's just I've got from impression from my reading Flex likes to be one 'screen' that changes in context with the users actions - not all applications would follow this model, they'd demand numerous of those context changing screens?

    Most of the app examples on the Adobe site are enhanced websites or data displays for BI type work.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Tue 13 Jan 2009

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

Elsewhere

Here are the external links posted on the same day.

More links are available in the archive »

More Content