Anyone wanna build a benchmark Flex app?

| 9 Comments | No TrackBacks

I wonder why XUL never took off in the RIA space... This is pretty amazing, especially looking at the code - I'd like to see a side by side of this and a similar Flex application to see how they compare.

Mozilla Amazon Browser

Time to ramble a little bit.

I love Flash. I think Flash is amazing because it has a somewhat low cost of entry and allows people to be very expressive both visually and through code. It's a tool that brings designer and developer together, and some of the creations out there on the internet are incredible, even awe-inspiring. Have you seen a Flash piece lately that made you say "wow, I wonder how they did that..."?

The virtual machine is a thing of beauty. It's amazing how much functionality is crammed into that small little package, and it's somewhat mind-blowing to think how much Flash can do. It even has it's own video codec...

Additionally, ActionScript may seem like a simple language at first (hey, it's just a "scripting" language), but I'm continually amazed at the power of it. It's amazing how much flexibility it's prototype model allows, and funny how it's dynamic nature can make complex things in C downright simple in ActionScript. I have to wonder if Flash is looked down upon because people simply haven't given it enough credence to explore what it can do. I sometimes wish the days of the 99% bad skip intro web never happened.

Anyway, where I'm going with this is that Flash is an amazing tool if you get to know it. I think it allows you to easily create pretty much anything you can envision. I only complain about it because I want to see it continually be improved upon. With some of the FUD about XAML and/or XUL killing Flash, and the uncertainty of what the web will look like in 5 years, I want Flash to be solid and feature-rich enough that it doesn't get pushed aside by some other technologies.

That being said, I direct you to the Mozilla Amazon Browser. You need a Mozilla-based browser (what, you're not using FireFox yet?) to view this Rich Internet Application, but I think it's an inspiring piece. Yes, Flash and RIA are not necessarily synonyms. - you can make RIAs with *gasp* other technology.

I wonder if one of the reasons XUL hasn't exploded yet is because it just doesn't have the penetration that Flash does. I wonder how many developers know just what XUL can do. I admit that I'm not even close to a seasoned XUL veteran yet, but in what free time I have I'm exploring leveraging XUL to build cross-platform Flash applications.

Now, why did I mention Flex in the intro paragraph? By now we all know that Flex is a server-side technology to build "rich internet applications" with an XML language (MXML). Combine MXML with a little bit of ActionScript, put it through a compiler, and get a .swf movie that runs inside the Flash player. Thus, the Flash connection.

Now, Flex and XUL are for the most part the same concept. I like XUL better. Here's why... (you don't have to agree.. this is my weblog, so the opinions here are mine and mine alone, unless I manage to convince some of you out there to agree with me...).

The XUL application is VERY responsive. When Flash gets inundated with large amounts of data, it simply dies with a nice little "hey stupid, you tried to do too much in too short amount of time" message. This is bad. Very bad. Once a script times out (typically 15 seconds, but you can adjust that in version 7 .swf files), no more code in the movie can execute. This is equivalent to, say, a core dump in a C program that renders the program useless and doesn't let the user continue.

While Flash is crunching away at data, the UI suffers. There is no threading engine in the Flash VM, so all mouse clicks and such must wait until the code on a particular frame is done. If you've ever looped over 50,000 records, you know what I'm talking about... XUL doesn't have that problem.

Why is this such a problem to begin with? Because if Flash is going to be used for "desktop-like" applications, then it needs to have some certain desktop-like features. The main feature I have in mind is a responsive UI. If Flash is chugging away at data and doing something behind the scenes, the user should still be able to interact with the interface. Anything less than a 1 second response time is no longer "real time" from a user's perspective.

So the XUL application is more responsive than typical Flash RIAs.. big deal.

I think the next major benefit to XUL is that it has a consistent UI, blending in with that of the operating system. In fact, when I launched the application, it opened up in a new window, had a file menu, was resizeable, had an icon-toolbar, etc, and looked just like a desktop application. This is huge as far as users go - there's nothing that gives this application away as being "different" from "regular" desktop applications, and gives the user a seemless overall experience.

Granted, the Flash Halo theme is nice, but some of the components don't behave quite like those of the desktop. Little quirks like this can frustrate users. I don't really care if my combobox "bounces" when it opens. I care that when I tab into it, it behaves just like other comboboxes do in my desktop applications. Maybe the combobox wasn't the best example, but I think you get the idea.

So where am I going with this? Well.. building XUL applications is actually very easy. You use an XML language to define the interface, and you code the application with JavaScript. Guess what, JavaScript and ActionScript are almost one in the same. If you're decent in ActionScript, you should be able to jump right into developing XUL applications without too much effort.

Guess what else. The look and feel of the XUL application is all done through stylesheets. Look at all of the themes available for FireFox... If you're drawn to Flash because you can make applications look different, XUL applications can be skinned too... and easier than trying to skin some of the v2 Flash components.

Anyway, where was I going with this?

I'd like to see a Flex application that behaves just like the Mozilla Amazon Browser. I think a side by side would be useful for the Flash team because they can see how the player stacks up to some other technologies out there. By doing a side-by-side, it should be easy to identify the level of effort involved in creating both XUL and Flex applications (which is easier to code, or are they about the same? which is easier to skin? which is easier to maintain?).

I think the next version of Flash really needs some sort of threading engine to keep playing in "rich internet application" space. It needs to not die when you're trying to do any sort of data processing. The v2 components are new in Flash MX 2004 and I'm sure will continue to improve, but they need to be easier to skin. If we stylesheet was as complete as what XUL supports, that should making skinning much easier. I'm sure there's other "how to make skinning easier" ideas out there, too. And I'm also sure that Macromedia would love to hear them all.

Anyway, I wish I had more free time to build a Flex version of MAB myself.. but I just thought I'd throw the idea out there to see if anyone wants to pick up on it.. Any takers?

Sorry for the long rant.. I was using this XUL application the other day, and it inspried me to post this. I'd like to Flash be able to do this as well as Mozilla does.

No TrackBacks

TrackBack URL: http://www.darronschall.com/mt/mt-tb.cgi/10

9 Comments

Thanks for the recommendation on that Amazon tool... I'll check it when I'm on another machine. (Right now I'm in Safari.)

I would also have gone with that "penetration" angle you wrote about... it's the difference between "if you'd like to do X, try this" and "if you'd like to do X, and also fit into subgroup Y, then try this." SWFfy stuff can work in a great superset of Mozilla environments.

The "50,000 records" situation reminds me of this:
http://www.markme.com/jd/archives/005543.cfm

What would you hope to accomplish with "a benchmark Flex app"?

jd/mm

Hi,

I don't have mozilla installed, so I am not sure of the comparison, but there are I think 4 samples apps for Flex as an Amazon front end on Christophe's site (http://www.coenraets.com)...they aren't fully polished, more for teaching development of Flex apps than as demos, but could be a good start to building a side by side comparison.

BTW, A well architected Flex app should be very responsive...how fast it responds depends far more on application architecture than on whether one uses Flex/Flash.

Lastly, the look and feel of a Flex app is also done through CSS stylesheets.

But, right tool for the right job....

Regards,
David
Macromedia

Hello Darren,

can you please tell me how can i setup the script timeout value for flash 7 swf?


Kind regards,
Alex

hi Alex,

You can set the scriptLimits tag in your swf using Flasm: http://flasm.sourceforge.net/


I'd like to echo Darron's shout for a threading engine in the next player - surely Flash is old enough now to walk and chew gum at the same time? :-)

I'd just like to say that I'm not interesting in seeing regular Flex sample apps. I've seen them before, and they're good examples of RIAs in action.

What I'm interested in seeing is a direct example of how the same application is different technologies compare. I think the Flash player has too many limitations right now to compete with an identical XUL application.

Plus, I'd like to see a Flex app clone the XUL app to see which is easier to develop in, which one has the better overall user experience, which one is easier to maintain, etc.

As far as user experience goes, I think XUL wins hands down. I know Flash well enough to know *how* to skin the v2 components, but it's an absolute nightmare and not a trivial task at all. Skinning in XUL is a trivial task, and I'd like it to be that easy for the v2 components as well. Again, I only complain because I want to see things improve.

The right tool for the right job is correct - and XUL is just as good in the RIA space as Flex is. I also believe that it's in fact better. The only downside is the penetration statistics and the requirement to use Mozilla, but the user experience is better than anything I've seen Flex do (yes, XUL apps can drag and drop too). Plus, there's no new skills are invovled to develop in XUL. Its just XUL (html-like), JavaScript, and CSS for styling.

I guess another thing to point out is that XUL is completely free whereas Flex is $12,000. For roughly the same technology, I don't see how that cost can be justified. I digress though...

I found that Amazon application a few months ago and had the same reaction as you did. I've been thinking about XUL and Flash a lot lately. I agree with you that XUL's big problem is "player" penetration, but judging by the recent Firefox adoption stats, I think that you'll see that change dramatically in the next year or so.

Plus, XUL has something Flash doesn't:

XUL is an XML language based on W3C standard XML 1.0. Applications written in XUL are based on additional W3C standard technologies featuring HTML 4.0; Cascading Style Sheets (CSS) 1 and 2; Document Object Model (DOM) Levels 1 and 2; JavaScript 1.5, including ECMA-262 Edition 3 (ECMAscript); XML 1.0.

Hey D/all

Just to share, I had to implement a pseudo thread engine. Basically, I used intervals and loops. So on large data sets we'll loop through the data X number of times every Y number of milliseconds. The X and Y values are adjusted dynamically based on system performance, etc. Later I took it a step further using the command pattern where each command generated was given a priority. The higher the priority the sooner the command would get executed.

I'm in the process now of cleaning up and optimizing the code and was going to release it to the community in the next couple of weeks.

-erik

wow, MAB is outstanding. As far as I know, I think the real differences between a Flash/Flex solution and XUL are:
1) MAB can run remotly and can be installed on the hard drive as a Mozilla/Firefox extension. And the code is the same! The only difference I noticed is that in the installed version you can save result list, but you can't using MAB remotly.
2) I saw that changing the Mozilla/Firefox theme the MAB layout change too. This is great because you don't have to design the interface.
3) With Flex you can use SOAP while MAB use simple XML over HTTP.

Looks like Danny Dura stepped up to the challenge and delivered.

http://www.danieldura.com/archives/central/flex_on_the_desktop.php

Leave a comment



About this Entry

This page contains a single entry by darron published on July 14, 2004 7:08 PM.

Flash and the Physical World was the previous entry in this blog.

A flash desktop revolution... is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

OpenID accepted here Learn more about OpenID
Powered by Movable Type 5.02