Wednesday, March 08, 2006

Windows Communication Foundation (WCF) and Windows Presentation Foundation (WPF)



I have been recently to two MSDN events (Reading, UK) about core technologies that Microsoft will ship in Windows Vista in 2006 and which are related to another set of technologies called WinFX.

This is a summary of the information I put down during those events. Look at the bottom of this email for further resources.

What is Windows Vista? What is WinFX?

- Windows Vista is the new Operating System

- Win FX is a core part of that Operating system regrouping 3 technologies:

1) Windows Presentation Foundation - WPF - (aka "Avalon")

2) Windows Communication Foundation - WCF - (aka "Indigo")

3) Windows Workflow Foundation - WF

- Win FX has 3 goals:

a) Unification of the different APIs

b) Simplifying and reducing application code

c) promoting declarative development

MSDN Event #1 - Windows Communication Framework (WCF)

- WCF has 3 goals (same as WinFX):

a) Unification of the different APIs

Web Services, Remoting, DCOM, MSMQ, ...

b) Simplifying and reducing application code

c) Using declarative means when possible (via XAML)

- Communication via "Endpoints"

.Endpoints may advertise metadata (design time and/or runtime)

.Every Endpoints have to defined 3 things

- An address - WHERE this endpoint can be found

- A Binding - HOW this endpoint can be accessed.

- A Contract - WHAT/WHICH service is exposed by this endpoint

- Channels move messages

.Messages do not always travel as XML (e.g. binary)

.Messages do not go always on the wire (e.g. interprocess call, intercontext call, ...)

.MTOM: binary standard over SOAP

- Bindings Create a "Stack" of channels

.Security Channel -> reliable channel -> HTTP

- Applications Exchange Messages

.New serialization

1) System.Runtime.Serialization

2) System.Xml.XmlSerialization

3) DataContract / MessageContract

2) -> "Opt-out" model: you must declare what you do not want to be serialized

-> good when starting from an XML Schema (XSD)

3) ->"Opt-in" model: you must declare what you want to be serialized

-> good when starting from source code

- Message Exchange Patterns

.One way (Fire & Forget)

.Request / Response

.Duplex (2 "ways" opened)

- Fault

.Use of attributes, e.g. [FaultException]

- Instancing, Concurrency, Sessions

."Sessions" communication need reliable protocols, e.g. use of WSHttpBinding

.Instance management service => machine wide?

- Securing Message Exchanges

.Certificate store will check:

a) still valid

b) the Authority which has issued the certificate is "trusted"

c) the Authority which has issued the certificate is not "untrusted"

- Inforcard

.Built on open standards => XAML & WS-Trusted

.Middle man between a "service provider" and an "Identity provider"

- Transactional Messaging

.The new "MS-DTC" will implement WS-AT (Web Service - Atomic Transaction) as well as COM+ (or OleTX)

.Change on the Interface

=> use for generating the contract (WSDL)

=> use for generating the policy

MSDN Event #2 - Windows Presentation Framework (WPF)

- WPF has 3 goals:

b) Utilise the power of graphic card processor units (GPUs)

a) Unification of the different APIs

Windows 2D (GDI), Media SDK, Printing, 3D (Direct X), ...

c) Using declarative means when possible (via XAML)

=> WPF as a Vector engine as its heart

=> 2D and 3D graphics will run on top of that vector engine

- UI Development evolution

- Everett (Visual Studio 2003)

. .NET class defined inside one source code file + Regions to collapse code for more readability

- Whidbey (Visual Studio 2005)

.Multiple source code files for one .NET class (take the fact that .NET 2.0 support partial class)

+ One file used by Wizards, e.g. UI Wizards

+ One or more for your code

- Orca (Visual Studio + WPF)

.Use of XAML (full separation between UI element definition and application code)

- XAMLPAD: tool part of Windows (Vista)

- There is a WinFX extension for Visual Studio 2005

- v1.0 of WPF will have some of the Windows 32 control, but not all (e.g. the Grid). It will also have new ones, such as "Containers".

.WPF has the notion of Container (like Java UI).

.In WPF everything can be contained => Recursive concept

(this is a key concept and its the one that allows to build astonishing UI, not sure about the "usability" for the end user ;)) )

.WPF offers different containers:

-StackPanel (the basic one)

-DockPanel (same as Java)

-WrapPanel (a bit like an "HTML" browser)

-Canvas (like WinForm or Win32)

.(X;Y) positioning

=> Avoid it - Not very dynamic or localisation friendly

-Grid (WPG version different from the Win32)

- WPF is able to address subpixel, i.e. floating values - GDI addresses pixel (using integers)

- WPF (or Vista not sure) will come with a new "ClearType+" technology

."ClearType+" uses anti-aliasing on X and Y-axis

.increase attention by 5%

.increase reading on screen by 17% (not sure how they got those numbers)

.every fonts have been "vectorized" => good looking at any resolution !

- XPS technology for stream or printers

.It is a subset of "XAML WPF"

.16 bits channels for RGB components (Red,Blue,Green)

.Manage Transparency

=>Printers makers are adopting and implementing that technology in their product

When

# Windows Vista

=> CTP released December 2005

=> Release: 2006 ???

# WPF

=> CTP released January 2006 (no Go-Live license on this)

# WCF and WF

=> CTP released January 2006

=> Go-Live license - The License must be agreed and signed (only if you intend to use it in a production environment)

# WSE 3.0 and WCF

=>At code level: WSE 3.0 programming model will be the same as WCF. Change will be more on namespaces and classes/structs names. If not, MS will provide tools to ease migration or guidlines on how to make the migration.

=>On a production environment (runtime):

.WCF will be compatible with WSE 3.0 messages

.Security aspect should be compatible between both framework as well, but not other services (i.e. transaction, reliability, ...)

=>If starting a project now (or coming months), I do think WCF January CTP is the best option

Where to get more info

# Windows Vista

# Microsoft Pre-Release Software WinFX Runtime Components - January Community Technology Preview (CTP)

# Looking at installing it on a Virtual Machine (using Virtual PC or Virtual Server), here is a blog with some tips

# MSDN Events Information and Downloads


No comments: