BBC launches AIR-based news ticker

Posted by Neil on July 02, 2008

I’ve just seen on one of the many BBC editorial blogs that they have now re-released their age-old windows based news ticker application as an AIR app.

For me this is an interesting one for a couple of reasons - firstly, that this will result in a massive deployment of AIR across potentially hundreds of thousands of users, but also that they decided to not got down the Silverlight for any particular reason (and I’m sure Microsoft were trying to get in on this one).

Anyways, check it out and have a play.  Could it be the start of a new application development “standard” comig into being.

Flex vs Silverlight (in my eyes) 10

Posted by Neil on June 29, 2008

I’ve been spending a bit of time recently taking a look at the RIA market as a whole and the tools that are available within.  During this time, I’ve been spending most of that looking at Adobe’s Flex and Microsoft’s Silverlight.

For a little context, for those of you that don’t know, I am mainly a server-side developer, with a background in tools such as ColdFusion, Rails and Flash.  I have some knowledge of Flex, but not enough to make me truely dangerous (yet).

So, what’s the deal?  Well, in short, Flex is simply a library of components that are used to develop applications using Adobe’s flash runtime.  This gives you a massive amount of scope for what’s possible, as well as a fairly safe bet that any users you might have have the flash runtime ready to roll.  Development is done by writing MXML and Actionscript 3, preferably inside the Flex Builder tool (based on Eclipse) that you can buy from Adobe.  Flex runs on Windows, Mac’s and Linux in some form, and can be developed for free due to the fact that the runtime itself is open-source.  One feature definitely worth a mention is the support for AMF - a highly compressed binary format for data transport.  This protocol makes it highly performant when chucking data around the place.

So, let’s quickly mention silverlight.  Silverlight is Microsoft’s attempt at Flash, but with a .NET backdrop.  In it’s simplest form, Silverlight is a subset of WPF, the Windows Presentation Foundation, that a whole stack of Windows UI is now built with.  This means that any .NET developer worth his salt should be able to adapt and develop silverlight applications fairly easily.  Now there’s a problem here - I’m a Mac user at heart, and although I have a windows laptop available at the office, OS X is where I prefer.  However, as a Silverlight developer, you are bound into Windows as you’ll be needing tools such as Visual Studio 2008 and/or Expression Blend.  This doesn’t sit too well with me - if you’re developing for the web (any platform), you should be able to use any platform to do so.

So, what are the key differences other than those mentioned above?  Well, for me, Flex appears to be a bit more developer friendly - I can do all the things that Silverlight can do as well as use AMF, and the Flex Builder tools (when combined with Adobe’s creative suite) seem a little nicer than the Microsoft offering.  I can develop Flex apps on any platform, and run them pretty much anywhere.  I also like the way that Flex can seemingly sit with whatever tools you might use elsewhere, Silverlight definitely lends towards .NET due to the fact that the IDE and languages are used elsewhere in the platform.

On a side note there is something that bugs me about Silverlight apps, and that is the look of them, when using the default styles and skins, for instance, let’s take a look at a flex and silverlight app side by side (using the default skin):

First up, Flex:

and Silverlight:

Flex just seems to look smarter and less “Tonka”.  Silverlight has the look of a Fisher-Price “My First RIA”.

One other big thing worth mentioning, although slightly off topic, is Adobe AIR - I don’t see anything from Microsoft, yet, that appears to offer what AIR does.  AIR allows me as a web developer, to create desktop apps using Flex, Flash, HTML, JavaScript etc, and deploy them whereever I like.  Microsoft does have WPF, but that’s pretty much limited to recent windows installations and doesn’t really suit itself to web developers.  AIR is a huge selling oppourtunity for small agencies, and Microsoft just don’t have anything to offer as an alternative.

Lastly, it’s worth mentioning the vendors themselves.  Both are great companies, with good product lineups, but there’s one thing worth noting.  MIcrosoft seem to understand developers and the creative agencies out there better than Adobe by a long shot.  For instance, the partner programs that the two companies offer are leagues apart, the Adobe one being hard to justify the ROI on.  Micosoft are genuine about working with partners, and helping them to help themselves, providing support, software and training where needed.  Adobe on the other hand seem to show no interest at all unless you are shifting LiveCycle licenses, which is a damn shame as they win in almost other respects for the budding RIA developer.

So, in summary, my views are this - Flex beats Silverlight.  I prefer the development story and the fact that I can develop it how I like and where I like.  If I were starting up an agency with guaranteed work I would go for the Adobe products every time…

BUT, and there’s a few buts, I don’t have guaranteed work, I need some help getting it - so Microsoft comes in to play.  With their awesome partner program, I have the resources available to me that help me be more successful as a business.  The question is, does grinning and bearing the slightly poorer tools make it worth it?

Getting Flex and Rails talking nicely with AMF

Posted by Neil on June 02, 2008

As a ColdFusion developer, integration with Flex is a very easy thing to do. ColdFusion understands Flex, and Flex understands ColdFusion. But what if we want to use another tool? What if we want to use the super-productive Ruby on Rails to build our backend? Well, thanks to the MidnightCoders that's now nice and easy to integrate with thanks to their WebOrb Product (which is free of charge thankfully).

So, how is it done? Well, let's walk you through it:

First up, check you have Ruby and Rails installed:

rails --version

If you get back a response giving you a version number, you're good to go. If not, consult the Rails documentation. Now let's create a rails app:

rails myrailsapp

...and install WebORB into it...

cd myrailsapp

ruby script/plugin install http://themidnightcoders.net:8089/svn/weborb

Easy so far? OK, Well let's take a look at it:

ruby script/server

Browse to http://localhost:3000/examples/main.html and you should be presented with a testsuite for your app and it's WebORB install. Easy.

So, what does this mean for you from the Flex point of view?

Well, WebORB basically pretends to be Flex Data Services, thus making the configuration nice and easy for you. Your root folder becomes your rails app config folder (myrailsapp/config) and the root URL is your webORB controller (http://localhost:3000/weborb).

For the output side of things, you should output your flex content to the /public folder of your flex app (/public/flex for instance), and point the URL to that same location (http://localhost:3000/flex).

Once you've done this you can go through the normal steps as you would with any FDS application. Setting up the destination/source in your remoting-config.xml etc. Once you're done, you're done. You can now talk to Rails as you would a CF application.

For example, Flex application declares a remote object using the RemoteObject API (for a getComputerInfo method):

[The requested file http://neilmiddleton.com/Mods/http://neilmiddleton.com/Mods/2008/06/ra ils_amf_sample_1.txt could not be found]

When a user clicks the 'Get Computer Info' button, the following function executes a remote method invocation:

[The requested file http://neilmiddleton.com/Mods/http://neilmiddleton.com/Mods/2008/06/ra ils_amf_sample_2.txt could not be found]

When an invocation response is available, Flex invokes a response handler specified in the tag. The response handler in the example, populates the text fields with the data available in the returned object:

[The requested file http://neilmiddleton.com/Mods/http://neilmiddleton.com/Mods/2008/06/ra ils_amf_sample_3.txt could not be found]

The source code for the server-side rail as object is below:

[The requested file http://neilmiddleton.com/Mods/http://neilmiddleton.com/Mods/2008/06/ra ils_amf_sample_4.txt could not be found]

and that's pretty much it. You can now do what you want with Flex and Rails.

So, what’s coming in Flex 4? 1

Posted by Neil on April 16, 2008

Adobe have published some information on what's up and coming in the future Flex 4 release (codenamed "Gumbo").

Although caked in a fairly thick layer of mar-bollocks (marketing bollocks), there's a load of interesting information in there.

For a start it looks like Adobe are going to try and move away from the default Flex skin that nearly every single app seems to be released with.  This is understandable, as currently it's easy to spot a Flex app vs that of Silverlight, or POF (Plain Old Flash - just made that one up).  This will be achieved via some changes to the skinning architecture whilst maintaining backwards compatibility to Flex 3.

Other details are still to be released, but at the moment sit under the headings "Accelerated Development", "Horizontal Platform Improvements" and "Broadening Horizons"

There's very little there, but expect some form of code generation tool, possibly some form of frameworks integration (Cairngorm?), possible cross-runtime features (export to other runtimes potentially?) as well as a general spit and polish throughout.

Flex 4 has no dates yet, but as always you can keep up to date on the Adobe Open Source website.

FlexCover - Code Coverage for Flex

Posted by Neil on April 14, 2008

I've just come across FlexCover over on Google Code - which looks like an absolutely fantastic project.

Brought to be by Joseph Berkovitz, FlexCover provides code coverage instrumentation, data collection and reporting tools for Adobe Flex and AIR applications.

To quote the description on the site: "Flexcover is a code coverage tool for Flex, AIR and AS3. It incorporates a modified version of the AS3 compiler which inserts extra function calls in the code within the SWF or SWC output file. At runtime, these function calls send information on the application's code coverage to a separate tool; The modified compiler also emits a separate "coverage metadata" file that describes all the possible packages, classes, functions, code blocks and lines in the code, as well as the names of the associated source code files."

FlexCover UI

The site mentions involvement from Alex Uhlmann from Adobe Consulting, which should give the project a massive PR boost.

If you're unit testing with Flex  - and if not, why not?  You should check this out.  There's no point in getting 100% of your tests passing if you're only testing 10% of your code.

Just a quick footnote: I've not had a chance to try this out yet, so haven't commented on it's current development state.  This is very much an early release - so you will probably find issues.

Flex-Docs.com on the Flex Show 1

Posted by Neil on March 27, 2008

In this weeks Flex Show podcast you'll hear that Flex-Docs.com has been mentioned by the hosts Jeffry Houser and John Wilker.

If you haven't listened to the Flex Show yet - you should, it covers all Flex related stuff.   If you're a CF developer you should also listen to the Coldfusion Weekly.

Flex-Docs.com Flex 3 coming soon

Posted by Neil on March 25, 2008

A few of you have emailed me pointing out that Flex-Docs.com only includes the Flex 2 API at the moment (which I was already aware of).

So you know, I'm currently talking to Randy Nielsen, the Flex Documentation Manager @ Adobe to get the current API's from them, in order to compile the source files I need for Flex 3 support. Once this has been done and the files have been sorted out, you should see Flex 3 coming to a site near you real soon.

Aside from that, any additional comments are welcome as always.

Making sure your Flex is initialized 4

Posted by Neil on March 20, 2008

I've just banging my head against a brick wall for the past half an hour trying to work out why a bit of Flex MXML was crashing as soon as it was loaded. I had a situation whereby a label component was coming back as null once called from an event handler. Dipping into the debugging view confirmed this.

The issue? Well, the event was fired as soon as it's parent component was loaded, which was also before the Label had started to load (note that the order of nodes in your MXML does make a difference). Consider the following code:

[The requested file http://neilmiddleton.com/Mods/http://neilmiddleton.com/Mods/2008/03/in itialized.txt could not be found]

By using this.initialized you are able to check that the parent node has loaded (in this case, the Application, but sometimes the containing component), and therefore run your code relatively safely.

I guess best practise would say that you should always check for initialization signatures regardless - better safe than sorry.

New Flex Documentation Site

Posted by Neil on March 19, 2008

Yesterday I set myself a little challenge.  How much of a website could I build in an hour.  It had to be finished and production quality.

The answer?  flex-docs.com.

Flex-Docs is a Flex documentation lookup tool of a similar veign to good old CFQuickDocs.com.  Currently it only contains Flex 2 stuff, but over time will change to Flex 3.

flex-docs.png

Check it out, it might be useful to someone out there.

I’m a RIA N00b… 2

Posted by Neil on October 15, 2007

Yup, thats me.. Mr Server-side with a whole lack of Rich Internet goodness in my head.

If you're anything like me you're a CF (or server side) developer who's kinda intrigued by the whole RIA movement that's occuring.  You've probably also dabbled in Flex, DHTML, Silverlight etc and not really got anywhere.

Well, I've been thinking about this problem and have decided to make a concerted effort to get better at producing RIAs whilst sharing the knowledge with everyone as I go along.  What I plan to do, is work my way through some material (suggestions welcome) that will take me through a subject (Flex will be first - then probably AIR).  From here, and at regular intervals I will write up in this blog what I have learnt in a way that I (and you, oh server-side developers) can relate to.   I help you via the articles, and hopefully, you lot can help me via comments.
Hopefully by the end of it, I'll end up knowing how to use the tools, as will you, and we'll also up with a repository of tutorial style items aimed at server-side developers.
Before I start though, does anyone have anything in particular that they would like to see taken into consideration?  Anything that they particularly want me to cover?