Friday, May 12, 2006

Intro to WinFX

Jenny and I attended a MS event about WinFX on the 12th. Hopefully, this post will serve as a mini intro for anyone else interested in Microsoft's upcoming technologies.

WinFX is basically MS's new API for windows. It can be accessed via .Net 2.0 code and will come bundled as part of the next OS, Vista, as well as being available to install on WinXP and Server 2003.

There are 3 pillars of WinFX that all follow the somewhat famous architecture outlined by Jack Greenfield in his article, "Software Factories." Greenfield was formerly a bigwig at Rational, where everything had UML as it's foundation and was supposed to be the shiznit, but fizzled. Now his new ideas of using useful models to build real software (though there's more to the article) are becoming a reality. So the model is the code - just as you can design a form in our current tools and it is the actual form you run, so you can create models in a designer and it is the actual logic.

Another main point about the new paradigm of development is that imperative and declaritive code can be separated much more easily. So all the details of what you want to do (connect to this data store, use this protocol, make the interface look like this) are very easily separated from how (business logic). All the declarative code goes into markup (XML or XaML).

So the 3 pillars are:
  • Windows Presentation Foundation - The all new UI.
  • Windows Communication Foundation - Web Services (or services that may reside on the same machine) enabling a service oriented architecture at any level.
  • Windows Workflow Foundation - Modeling as described above.
Presentation Foundation (formerly Avalon)
The UI uses "XaML" to represent any damn thing you can imagine. The graphics engine supports regular bitmaps and vector graphics. There is a pure UI designer piece called "Expression" whose graphics manipulation capabilities I can't adequately describe. With XaML you can describe how you'd like a graphic to rotate, zoom (and vector graphics are crystal clear at any zoom factor), or whatever. The controls you create that display all these graphics can reference templates for consistency. Then the XaML is transferred to the developer. Here's a video of a real application utilizing the presentation foundation. One presenter mentioned that you will be able to run the same XaML on the desktop as is the browser, but this didn't seem to add up as there was a different Expression tool for web pages...

Communication Foundation (Formerly Indigo)
Connect to anything using any transport mechanism with the same type of interface. In a sample app, the presenter had connected to web services, but had also wrapped up communication with a regular human interfaced web page (querying availability of a product on a retailer's web site) for use in the same fashion. So you communicate with another WinFX local service the same way as a web service.

Workflow Foundation (Formerly I don't know what)
There used to be another piece to the WinFX pie called "WinFS," the "FS" for file system, I presume. This piece dealt with an entirely new way to manage files. Files had extensions (not in the name) that allowed for sophisticated organization and retrieval. I'm not sure how much of that stayed in WinFX; as far as I can tell workflow foundation only deals with what I discussed above about being able to visually design your application's logic.
You drop activities down on a design canvas and wire them together as a sequential diagram, a state machine (basically event driven), or as a rules driven machine. You can even simply set a breakpoint on your activities and then step into them if they have additional code behind them. I think this will really encourage code re-use and third party vendors are already making lots of useful "activities". So one of the out-of-box ones (I think) would be send an email message. Drop down that activity, set some of it's properties and let 'er rip. Activities can contain other activities, so you could even have a main activity be one that is the main gateway to persistence (save to data store). Then each time execution enters that activity, it may flow into different sub-activities. Another cool activity example is Amazon's purchase item activity.

No comments: