New Book: Professional Flex 3 Available Today.

Media_httpwwwsimplifi_bdgrq

It’s Here!  For about a year I worked with a team of smart guys (Andrew Trice, Joseph Balderson, Peter Ent, Jun Heider, Tom Sugden, David Hassoun, Joe Berkovitz) to create what we think is one of the best books out there on Adobe Flex.  It’s around 1400 pages, nearly 5 pounds, of comprehensive knowledge.  It’s available at Barnes and Noble and Amazon.Com, and probably your local bookstore or wherever Wrox books are sold.

I’m proud of this book.  It was hard to write and took way more time than I thought it would.  But the end product is outstanding.  It’s one killer book that covers a lot of the internals of Flex, including the extras like Cairngorm, unit testing, AIR, Flash Media services, FXG, Flex Builder, Subclipse, custom components and the component lifecycle, skiing, Flash integration, etc…  It’s all covered.

I was responsible for writing about Adobe AIR and a lot of the server side data stuff, especially in regards to open source, Java, and .NET.  I did a lot of work to show the flexibility (no pun intended) of working with Flex and a variety of back-end technologies.  Specifically I have demos in there working with server-side data using:

  • PHP and the Zend framework over a RESTful-based framework
  • Java WebServies created using Grails and Groovy.
  • .NET with WebServices

I have some follow ups that I want to write about.  Specifically, I want to port the Zend framework samples to use the new AMF support.  And while I’m at it, I’d like to port the Grails example to use AMF, too.  BTW, I believe GRAILS is the Holy Grail (dang, another bad pun) for Java Developers wanting some syntactical-love in their lives, yet at the same time harnessing all those enterprise APIs and existing operational infrastructure that seem to chain them down.

To get you started, Andrew Trice, one of the co-authors, has posted a nice excerpt from the book: Chapter 67: Application Performance Strategies.

While Flex 4 and Flash Builder 4 are on the horizon for being released, they both still rely on the fundamental technology presented in this book.  This book will be a great addition to your team library, especially for getting your new developers up to speed, or your existing developers to learn some advanced techniques.

Go forth, read, and build great applications.

Microsoft's Silverlight Disappoints

Preface: I initially started playing with Silverlight with the hopes of writing software that will run on multiple platforms, mostly Mac and Windows. The goal of this article was originally to develop a cross-platform application using Microsoft's Silverlight platform and the IronPython language. It didn't take me long to realize that all this alpha software has holes in it for developing a simple cross-platform applications. I understand that I'm playing with alpha software and that many of my gripes will be fixed in the future. (I hope so, anyway.)

And now we start
I've seen some demos applications created with Microsoft's Silverlight (formerly called WPFe) development platform. They look sharp and snazzy and modern. With the release of Silverlight 1.1 Alpha, Microsoft releases the ability to use .NET languages to create Silverlight applications. Included with this is the new DLR , Dynamic Language Runtime, and the ability to program with your favorite dynamic languages, like Ruby or Python via Microsoft's IronRuby or IronPython implementations. This would be a big bonus if I could use my favorite language to create Flash like applications. I started the process of gathering all the required installs from Microsoft's Silverlight website. I was planning on developing with IronPython 1.1 since IronRuby hasn't been released yet, and then porting a simple image viewer application that I wrote in WPF (Windows Presentation Foundation) a few months ago. Well, after installing most of the required files, looking at samples, and getting a better understanding with what Silverlight is, I've now decided this article is about why I can't build my sample application.

There's lots of Beta and Alpha software required to preview Silverlight. I don't have a problem with most of it because the downloads are small, and the intrusion to installing into the system is minor. However, there's one nasty required install, and that's Visual Studio Orcas Beta 1, the next generation of Visual Studio. It's a whopping 6 Gigs to download (approximate). Why do I want developer tools that are SIX gigs in size? This is one of the reasons I'm going back to simpler development technologies. After all, the process of coding an applications is pretty simple: write text into a document, compile/build it to some form that is executable, whether it's files being pushed to a web server for viewing over the web, or a native executable that a user runs on their Mac or Windows box. The development process is all essentially the same for anything a developer does, write text, package it. While it's nice to have a development environment aid in writing a lot of this text (especially the mundane and repetative), there is a line in the sand where having the environment do too much is a bad thing. Ever since Visual Studio 2003, I've hated the wizards built into Visual Studio and how it allows a developer without the proper knowledge to create a mess of a project. I can install simpler development tools with features like Intellisense for less than 40 megs (look at Active State's Komodo). Even the install for Eclipse is less than 130 megs.

Anyway, I started looking into developing a simple Silverlight application with a text editor since this is how I developed my first ASP.NET application six years ago, and it's also how I started learning WPF. When I started with WPF, I used XAMLPad, and Visual Studio Express for C#. I installed a SDK and some Visual Studio plug-ins and I was off developing. Maybe because Silverlight is such alpha code, it doesn't have this integration yet? Maybe, MSFT never intends to support an Express version of Visual Studio? Hopefully not.

I started working with plain text files and Notepad++ and looking at the sample apps. I copied the Python PhotoViewer project to use as my template (the version I've linked to was written in JScript since MSFT doesn't have the Python one posted to their website) . It's very easy to get a Canvas up and running with a TextBox in it. But I wanted to so something more, I wanted to port my existing application. I quickly found out that there was no support for WPF Layouts, DockPanels, and ComboBoxs. What, not a basic control like a ComboBox? How is a developer to develop without one? Sliverlight doesn't come with any user controls, not even a button. If you were hoping to port an existing WPF application, you're really out of luck, even for a simple application that only has a few buttons and a combo box -- which mine does.

I shake off the dissapointment and continue up the trail
Included with theSilverlight 1.1 Alpha SDK is a SilverlightControlsStarterKit that has a few basic UI controls: buttons, a very basic listbox, scrollbars, scroll viewer area, and a Range Selector (a slider-like control). However, to use these controls, I needed to build them. In order to build them, I needed Visual Studio Orcas -- something I'm refusing to install.

I was very interested in trying to use the controls in the SilverlightControlsStarterKit, so I started hacking with the .sln files to see if I couldn't build them in a version of Visual Stuido that wasn't the Orcas Beta. After a few minutes I decided this wasn't a path worth going down.

I went to Google and started searching for Silverlight Controls ComboBox and couldn't find anything -- I was expecting another developer to have conjured up one by now. What I did find was that the third-party company Telerik was building RadControls for Silverlight -- not a ComboBox, though.

All is not lost!
There are a couple of nifty samples, though, in the Silverlight 1.1 SDK. One is the PhotoViewer written with Python as the language. It's located in the samplesPhotoViewerpython folder. Basically, a web page hosts the Silverlight runtime and calls some Javascript to load a XAML file, which binds to the code, whether C#, VB.NET, JavaScript, or Python. In this sample case, it was binding the XAML to IronPython with the following in the header:
<x:Code Source="Code.py" Type="text/python" />

That's the only change required in the XAML file to bind to the IronPython runtime. So Simple.

The DLR Console

Media_httpdocsgooglec_fakdu
The other cool sample is the DLR console runtime that allows you to play with different languages (Python and Javascript supported for now, I imagine Ruby will be in the future) and dynamically modify WPF properties in the display window much like the XAMLPad that comes with the WPF SDK allows with XAML. Look at the code in the window above, that's what Python looks like controlling the Silverlight API. Ahhhh...Python. Just wait until how beautiful Ruby will look!

Other Silverlight Disappointments and Revelations
I'm also disappointed that it looks like Silverlight will only run inside the browser, like current Flash applications. Adobe's been there, been doing that for years. I was really hoping to be able to generate executables for both Mac OSX and Windows (would also like to support Linux), but the only way I can think to do that is to make a native executable shim for each OS and embed a web browser that can host the Silverlight Controls. Not something that's entirely out of the question, plenty of people have been doing this with Flash. This led me to a revelation: Silverlight isn't my golden ticket to cross-platform simple application development, what I'm really looking for is a cross-platform WPF runtime.

I'm going to now research the upcoming Adobe Apollo environment, which promises Windows, Mac, and Linux runtimes. The only thing I'm not really digging about Apollo is having to use Adobe's ActionScript. It would be so much better if it supported existing scripting languages that many developers already know, like Python, Ruby, Perl, etc.. This was the draw for me to looking at Microsoft's Silverlight in the first place.

I'm not going to totally dismiss Silverlight, as an alpha is far from release, and the promise to be able to develop in Python or Ruby is quite enticing to me. I justvelopers to use. I could even write it in Python.

Questions/Comments for Microsoft:

  • Couldn't the compiled dlls SilverlightControlsStarterKit for these so we could at least start playing with them wit hope that when the time comes for Silverlight to be mainstream, I'm not going to have to use Microsoft's latest Visual Studio, that maybe they'll have a lightweight and free version like they do for their C# and VB and WebDevelopment platforms.

    And, maybe I should be a little less lazy and build a ComboBox in Silverlight for all dehout compiling them like we could the rest of the samples in the SDK?

  • What is the plan for including user controls? Is Silverlight going to be too lightweight (no basic controls that were even included in Visual Basic 3.0 14 years ago)?
  • Is there a document somewhere listing what features/controls from WPF will be supported in Silverlight?A Microsoft Silverlight Developer Reference, for those who are visual.
  • With Silverlight will we be able to install applications to target platform, like Adobe Apollo, or is Silverlight only intended to run inside the browser? I know the answer to this, but I'm hoping this isn't so. Silverlight isn't going to compete against Apollo, but Flash in it's ability to stream custom content to custom embeded applications.
  • Is there ever going to be a cross-platform runtime for WPF? (This is what I'm really looking for.) Learned that NOPE, not unless we wait for Mono to port .NET 3.0 Looking at the new Microsoft Developer Reference image (link below), there are some classes in Silverlight 1.1 that aren't in the current .CHM document, most interestingly to me is the Windows.Applicaiton class -- hmm, could this mean anything for my desires?
  • Remember your target audience for these Alphas includes the hardcore developers, especially those who don't want to install massive beta software. Delivering some simple text file templates would go a long way. (I should clarify, that you only need the simple SDK to start your fun hacking, but my complaint about this has more to do with Orcas being required to play with the included controls, which I wanted to do. This wasn't a well thoughtout comment.)