Introduction:

I’m going to keep this very factual. I’ve been developing Flash for the last 6 years and intend to carry on doing so, as a result I’ve learned to accept a lot of criticism and be open to review all things new, in effect I’m opening by saying I have not been “bought” as you will no doubt see in this article I aim to give an entirely balanced perspective, the politics interest me not, just the tech. With that in mind, I’ve been able to get very deep into WPF/E for the last week or so, I’ve always enjoyed dipping into a brand new tech and getting fully engrossed in it, so it was a nice experience to be given the opportunity (thanks). You may find me making a lot of comparisons to Flash, this is only natural for obvious reasons.

Ok let’s start with what it is. It’s a browser plug-in for Mac and PC browsers that displays graphics and animations written in XAML, an XML based markup language. To add interactivity and logic, right now you must use JavaScript, and you write that in a typically DHTML way with functions like wpfe.findName() being akin to document.getElementById(). At present the relationship between your markup and JavaScript is achieved by writing the names of javascript functions in your XAML event attributes, for example when an animation completes, or when the user rolls over an element. XAML is the one thing that links WPF/E (codename) with WPF (part of .NET3 and Windows Vista) at present.


The Technology:

Ok so I read online MXML looks like XAML. There’s quite a difference here. You can think of XAML more in the vein of SVG with SMIL and interactivity. It is not compiled into a binary, it is indexable in the page by Google if you link to it, or embed it directly in your XHTML page for example. So that leads to both problems and benefits when compared to SWF, it totally depends on the type of content you are creating. It can mean incredibly large files, something that zipping might help, it also means it can be easily generated by a server, and doesn’t then need to be compiled before it is viewed. It also makes things like frame based animation difficult, something that binary can do quite efficiently. So points on both sides there.

So that is the presentation layer. Now the logic. You use JavaScript. When I found this out my heart sank a little. Flash developers can be (and I am included here), complete snobs, since we’ve had a fairly decent language since AS2, with AS3 we have a language to envy, and JavaScript hasn’t really changed much over the years, it is stuck at about an ActionScript 0.9 level, in terms of how you have to go about programming with OO in mind, scope chain lookups and the list can go on. I’ve been lurking around the AJAX developer communities and I am sometimes in awe of how rudimentary the majority of the code is. I imagine there is a going to be a BIG sigh of relief when JavaScript 2.0 proliferates, and rightly so. Still having said this, developing with JavaScript wasn’t quite so bad, you can see some of my source later, there are thing you can do to organise yourself a little better, even if you don’t have real packages and so on.

Examples:

So here are some examples I’ve worked on this week. I’ve also worked up a small library of classes that are useful in not only WPF/E development, but also in JavasScript development in general, for example EventDispatcher, Delegate, and XmlHttpRequestHelper which turns the rather naff XMLHTTPRequest object which AJAX folk love, and makes it into something like LoadVars/XML in AS1 without the XML parsing abilities etc, you still can’t get progress out of it though, nonetheless it removes some headaches. I’ve included full source with all these examples.

http://richardleggett.co.uk/downloads/wpfe/Tests/Tests/

You’ll also notice that on that page I’ve included a couple of techniques that I’ve picked up over the week.

Conclusion:

This is the real tough one. How can a product that is not even yet 1.0 compete with a product that has been around for 10 years – they’d have to prise Flash from the developers’ cold dead hands on the most part. This is key when doing the inevitable and comparing it to Flash, just what is the hard sell that will make me use it over Flash right now – maybe nothing for a lot of people at least with v1. I do see a lot of potential in WPF/E, however, so I should explain this… When Nintendo released the DS and Wii, they had to compete in a world where Playstation and XBox owned all, they simply could not compete in graphical prowess and hardcore budgets, so they didn’t, they found a new market in terms of the price point and concentrated on their strengths, the Wii actually re-inventing gaming. So with that analogy in mind, you would be crazy to battle against Flash in the short-term, you need something more tangible…

It is crystal clear that MS are targeting AJAX developers, giving them the tools they want without them having to learn ActionScript or Flash, they are also targeting to some extent two other groups. Designers are key, the Blend and Design tools are being made with these people in mind, I think this is a very tough market to grab, but competition (and of course integration) between the tools of the various proprietors is to be welcomed. The final market is quite obviously people who are already using Windows Media Video, particularly live streaming (i.e. the *other* end of the online video market). These people traditionally use an embedded Windows Media Player in the HTML page which is pretty awful. I heard someone say that if WPF/E means they can make a nice video player for their content, the rest is a bonus.

It is always a time for predictions as we reach the end of a year. So for me 2007 will no doubt see the clash of several new web technologies, maybe the revival of some that have laid low (Java), but all in all this is best for people like you or me who are not afraid of learning something new and bolstering old skills. I’d also like to say goodbye to differentiating between whether something is made in AJAX or Flash, and even if something is a web app, RIA, or desktop application, separating these things into groups is done by people with legacy mind sets, and is a sure way to slow down the rate of advancement in the field of computing. I hope you find the examples and information presented here useful.

  • shunjie

    Posted: December 22, 2006


    Thanks Richard for the article, I think this is a very well balanced article. Without a doubt, wpf/e will have an impact in the RIA scene in the months to come. Ultimate, it is the question of 'why we need another framework' when Flex and Flash is around.


  • Ryan Stewart

    Posted: December 22, 2006


    Well done Richard, I'm putting this in the UDD tomorrow. Great writeup.


  • Jason

    Posted: December 22, 2006


    Hi Richard, nice and balanced article. I just wanted to point out that there's a problem with the link for the download. This link currently displays an error:
    http://richardleggett.co.uk/downloads/wpfe/Tests/Tests/Tests.zip


  • bluej

    Posted: December 22, 2006


    Very informative article. My question however, is what does MS suggest are the system requirements for WPF/e? I've got what I thought was a decent PowerPC (PowerPC 1.5 GHz) and even the simple rectangles example of yours brought my whole system down in a way I've never seen it brought down before. Okay, so maybe I don't have the fastest or latest computer, but I've never had any performance problems with any Flex content.


  • Bill Napier

    Posted: December 22, 2006


    Richard,

    Thanks for clear explanation of WPF/E versus Flash development.

    As a designer (and not a strict coder) I find it very interesting to see Microsoft attempt to undermind Adobe.

    Their use of Javascript and AJAX techniques along with indexable content will go a long way in overturning Adobe's lock. Having said that, I am pulling for Adobe in this one. I can appreciate the arguements of the w3 and CSS web purists but I can also get very excited about the possibilites of Apollo.


  • Rich

    Posted: December 22, 2006


    Sorry the link is now fixed:

    http://richardleggett.co.uk/downloads/wpfe/Tests/Tests.zip

    Thanks to all for your comments. As for the Mac requirements. I know this is being tested on a variety of Macs, however I may not have written a very efficient example (see the three animation types on that linked page, I think in that example I may have used the third).


  • Mike Harsh

    Posted: December 23, 2006


    Another comment on the Mac system requirements. The 1.5GHz G4 is plenty of machine to run WPF/E.

    We found a performance issue in the Mac version of the December CTP of WPF/E. We've fixed this issue and the next CTP will have greatly improved Mac performance.


  • Noah Gedrich

    Posted: December 31, 2006


    Great Article Richard. Glad to see you're really getting into the details on this.
    For the technology to really take off it's going to take people really banging on it and trying to use it in ways that weren't necessarily envisioned by Microsoft; working around its limitations and finding inovative ways to use it. Flash wouldn't be what it is today if people didn't spend years finding the hacks and strange solutions that are now considered the industry standards.


  • Ron Hudson MCSD

    Posted: January 2, 2007


    Bravo. Thanks for doing the research and providing us this brain dump on a key issue of the day.

    Thanks for Macromedia for forcing MS to provide a STANDARDS-BASED RIA tool. Flash eliminated much of the monopoly MS used to have on presentation with Windows Apps by providng rich content in the browser.

    Adobe attempted to leverage Flash's advantage by developing Flex to compete with VS.NET. Now MS has to counter-punch by going after Flash with WPF/E. How ironic that MS was forced to use STANDARDS (xml vs. binary download) to trump Flash.

    It will be interesting to see what the next move is in the Internet Architecture chess game. As a .NET and XML guy, I'm going to explore WPF/E as a shortcut to creating basic instructional animations on web pages. This will prevent me from having to learn Flash and get involved with "yet another platform vendor." As the writer of this article said, integration has its benefits.


  • Adam

    Posted: January 4, 2007


    I thought the E stood for 'Everywhere'... but, err, no Linux plugin?


  • Jack

    Posted: January 24, 2007


    Good article. One thing to note: The full version of WPF/E is supposed to be codeable in C#. So you won't be stuck with JavaScript. Whether that's a win relative to ActionScript is a whole 'nother question.


  • Art Scott

    Posted: February 12, 2007


    Way!

    Thanks.

    It can only get better.