The Business of Silverlight

04.04.2008

Chris Carper, a member of the Silverlight business development team at Microsoft, has started a blog about the business impact that Silverlight is expected to have on the industry. It’s brand new, so no real gems there yet, but we’re all looking forward to hear what the Silverlight team has to say about the business side of Rich Internet Applications..

Check it out here: http://silverlightbiz.blogspot.com/


RIA Wars Update: Silverlight 2.0 Is Coming

01.03.2008

It’s going to be an interesting spring this year; Microsoft has recently revealed some of the core functionality in the upcoming Silverlight 2.0 beta 1, which is expected to be released in the next month or so.

With Adobe Flex 3 just out, Microsoft is keen to show that their offering will be the better product, and they have certainly listened to the feedback from the  1.0 and 1.1 CTP releases, both of which were limited featurewise, frankly to the point of being useless.

Among the features included in Silverlight 2.0 beta 1 are:

  • - WPF-style layout using XAML, deeply integrated with Expression Blend (the design tool)
  • - A wide array of built-in controls (you know, TextBox, CheckBox, RadioButton, Panels, etc.)
  • - Support for REST, WS*/SOAP, POX, RSS, and plain old HTTP and even Sockets - yay :)
  • - Extensive .NET base class library support, including collections, IO, generics, threading, globalization, XML and local storage
  • - HTML/Javascript/DOM interaction with .NET code
  • - LINQ support

There is more, but they are not telling about it yet.

So what about install size, prerequisites and browser and OS support? I’m just going to quote Scott Guthrie, who knows everything there is to know about all things .NET and Silverlight, because I can’t word this any better than him:

“Silverlight 2 does not require the .NET Framework to be installed on a computer in order to run.  The Silverlight setup download includes everything necessary to enable all the above features (and more we’ll be talking about shortly) on a vanilla Mac OSX or Windows machine. 

The Beta1 release of Silverlight 2 is 4.3MB in size, and takes 4-10 seconds to install on a machine that doesn’t already have it.  Once Silverlight 2 is installed you can browse the Web and automatically run rich Silverlight applications within your browser of choice (IE, FireFox, Safari, etc).”

Collections, threading, globalization, Sockets and local storage .. It’s going to be great! As much as I love Flex by now, I can’t wait to get my hands on Silverlight 2.0 beta 1…

Read Microsoft’s accouncement on Scott Guthrie’s blog here, which includes a nice tutorial.


Flex, C# and Asynchronous Sockets Chat

18.02.2008

I’ve previously written about the wonders of Rich Internet Applications (RIAs), and I’ve have been looking at both Silverlight and Adobe Flex. For now, at least, I go with Flex, because it’s the mature and complete of the two.

After being sidetracked for a while with my love for casinos and games, I thought it would be appropriate to return to something more business-friendly. So, for my next project, I have chosen to implement a chat client/server with Flex on the frontend and C# on the backend. It could be used for customer service or be a community feature on a website.

I was thinking about doing the whole thing with Web Services, but that has a couple of shortcomings.

First of all, Web Services are stateless; Consuming a Web Service means sending one request from a client to a server and receiving one response. Each request/response pair is separate from all others - stateless. A chat application needs to be more “connected” the entire time, so that it’s possible to push things from either end to the other without the client having to continuously poll the server.

Secondly, Web Services include a bit of overhead in terms of SOAP envelopes, and requires code-generation (in Flex), etc., and I wanted something clean and fast. Ok, sure, my chat application probably won’t be used by thousands of simultaneous users, but why go for the Kia when you can have the Ferrari at more or less the same implementation cost?

The fastest ride in town is “asynchronous sockets”, and the easiest and cleanest implementation of that is using TCP. And luckily, it’s completely supported by both Flex and C#, so that’s what I went with.

Chat Client

http://www.topholt.com/ChatClient/bin-debug/ChatClient.html

A Few Implementation Details 

The chat client above is setup to use port 8000 for communications, so your firewall should allow you to make TCP connections to that port if you want to try it out. It shouldn’t be a big deal. If you download the code, you can modify it to use whatever port you like.

All communications are currently unsecured, which means no encryption, no authentication, no authorization and no data checks of any kind. The downside is that anyone can mess with the chat, but the upside is that you, dear readers, can grab the code and easily modify it for your own needs.

The application’s communications architecture is simple: Each time someone says something, a 256 byte UTF-8 encoded datagram is sent to the server and then immediately distributed to all connected clients, including the sender. That way, everyone sees what everyone is writing.

Edit: View Source on the Flash/Flex file to get the client code or download the zip. And get the C# server source code here. It’s built with VS 2008 and compiled for .NET 3.5, but should work just as fine with 2.0.

Edit 2: I’m currently having server hosting problems, so I am getting ready to move my stuff to a new provider. Therefore, the chat server may be offline at times. The code is still available for download, though.


RIA Wars: Silverlight vs. Flex

05.12.2007

I just love it when new technologies make my working hours as a systems architect and developer more productive. Granted, sometimes it takes a while before I catch on. I’m not really an early adopter (got my first iPod last christmas), but when I see something that can help me deliver a better product to my clients, you have my complete attention.

So about once a year, I venture away from my world of C#, business logic and backend systems and into the wonderful world of frontend and user interface systems, thinking that by now, after all these years, someone will have invented something that actually works. It was time for that again this weekend, and I must say it’s been a more interesting journey than usual.

I normally start looking at XHTML, CSS and Javascript, and every time I feel immediately disappointed: These technologies pretty much still look and feel the same, no matter how much IDE candy, code-completion and drag-and-drop you throw at it, and still behaves wildly different from browser to browser.

Next on my list is to download the lastest version of Flash whilst hoping that this time the good folks at Adobe have stopped smoking whatever it is they were smoking when they invented Lingo and have produced a real development toolset. Something that looks and feels like it could actually be used for serious development work. But this time, I didn’t get that far. One of my colleagues had for weeks been talking about something called Silverlight from Microsoft, which everybody was describing as “a Flash killer in C#”.

Silverlight

Silverlight turns out to be a very interesting and promising technology. It certainly looks like it was meant to be a “Flash killer”: You download a plugin for your browser and then you are all set to view so-called Rich Internet Applications (RIAs) that contain movie clips, vector graphics and all sorts of cool effects.

The thing is, Silverlight uses a declarative XML-based language called XAML and you code the entire thing in .NET. Yes, that means C# code which gets compiled and runs in a special, stripped down CLR inside the browser. Very cool.

But it gets better: It not only works in Internet Explorer, it also works in Firefox and even Safari on Mac. And the Mono guys are hard at work on a Linux version called Moonlight, apparently with some support from Microsoft.

I promptly downloaded the bits for the alpha version of Silverlight and the toolkit for VS2008 and set out to create something worthy of the RIA buzzword. And after playing around with it for some hours, here’s my current take on Silverlight:

  • - It’s really fun and easy to learn, and it really is C# on the client with vector graphics. Woohoo!
  • - It looks and feels like a real development toolset, because it’s based on VS2008, XAML and C# (or VB if you are slow).
  • - The IE7 browser plugin fails some of the time, both the released version 1.0 and the alpha version 1.1.
  • - The codebase and documentation for the 1.1 alpha is far from complete, but that’s to be expected.
  • - There are tons of features that I would love to see included, and from what I can read in the forums, I’m not alone.

So - Silverlight is something of a work in progress. They expect to have a new beta out in Q1 2008 (renamed to “Silverlight 2.0″), which should contain a lot of new features and with a Go-Live licence. My guess is that Silverlight would then become a “real” product during the summer of 2008. But the question remains: Is this a “Flash killer” ? Time to download that new version of Flash and have a look.

What the heck is Flex?

As it turns out, I must have been living in the land of Microsoft for too long, because I had never heard of Flex. Flex is Adobe’s development toolset for building RIAs, and guess what? It doesn’t look anything like Shockwave or Director, it doesn’t run on Lingo and most importantly, it doesn’t suck at all.

With Flex (version 3 beta 2), you can compile applications using an open source SDK if you have too much free time on your hands, or you can be smart and use Flex Builder, an IDE based on Eclipse which works like a charm! The end result is an SWF-file, which runs in any browser-based Flash player, or in a desktop application using Adobe Integrated Runtime (AIR). Completely cross-platform.

Flex is based on MXML, which looks suspiciously like XAML - or is it the other way around? You write code in ActionScript 3 (AS3), which is a script-language that is based on ECMAScript. Now where have I heard about ECMAScript before? Oh yeah, that’s right. It’s Javascript. Damn.

But as it turns out, it’s not that bad. Sure, things are not strongly typed, there are no generics, there’s no way to count the number of elements in an associative array except for the stupid way, etc., etc., but on the plus side AS3 and Flex as a whole is extremely easy to work with and well geared towards quickly and painlessly writing complex RIAs. And let me tell you: The feature set is no joke, and neither is the community around the product. Practically anything you can think of, someone else have already wrestled with and solved in Flex a long time ago. Need to integrated with something other than a simple web service? Or use sockets to communicate directly with someone? Or how about streaming and processing video or audio? Go right ahead, it’s all there.

I could go on.

And the Winner is..?

Perhaps Silverlight really will become a Flash killer - but I don’t think it’s going to happen over night. Flash players are (according to Adobe’s figures) present on 97% of desktop computers and well on the way to be a leading platform for mobile devices as well. Silverlight won’t get there for at least 12-24 months, if at all.

So for now, even though I do miss the consistant and strongly-typed world of C# and .NET, Flex is the easy choice for RIA development.

Let me hear from you. Am I missing something? Do you agree or disagree with my short analysis? Comments, please!