Share via


.NET Framework 4.0, Visual Studio 2010, WCF Enhancements

Microsoft believes that declarative programming is the best route to take for specific types of applications. One advantage of declarative programming is that you can indicate what you would like to do, but not how to do it.  Specifying the “how” is where the mistakes are made and where most of the time is spent.  As developers you want to express what you want ado and minimize expressing how to do it.

A good analogy is the blueprint for a house. A blueprint is not a recipe-it does not indicate in any way how to apply the structures contained in the blueprint. The builder takes care of those details. In the case of writing software, xaml would be the blueprint.

There are other advantages to xaml. First, you can leverage your existing xml programming skills. Another good thing is that it is human readable. And because of its natural structure it's easily programmable and it lends itself naturally to tooling.

Dublin is about joining WF to WCF seamlessly

.NET 4.0 will contain major improvements in both WF and WCF. The two will be integrated seamlessly together from the programming model to the runtime. Workflows and services are tightly coupled and both can be declaratively modeled by XAML. With the significant performance improvements in the runtime, the new workflow framework will enable a broad spectrum of model-driven programming scenarios.

 Expressing WCF Services with XAML

WCF services are completely defined in terms of XAML, including: Service contract definitionsEndpoint configurationsAnd the actual service implementation (in the form of a XAML-based workflow)

 WCF contracts can be defined with XAML

Note how we can translate the c# code into some declarative XAML syntax. imageThe xaml code below relates to the definition of a WCF Service. Keywords service indicates this and is in yellow. Notice further down in the xaml code we define a service contracts. After that, we defined our endpoints. In this case were using basic http binding.imageThis new syntax allows you to reference an interface for a contract directly by name.imageIn the case of Dublin, the implementation for the WCF Service would be the workflow. So this next section demonstrates the definition of a workflow using xaml.Service implementationThe advantage this type of coding brings it is transparency. You can just look at a few dozen lines of xaml code and be able to determine how the WCF Service is configured and how the corresponding workflow is defined. image Improvements in manageability - a quick summary

Process activation in response to incoming messages, process monitoring and health management, process recycling, CLR AppDomain integration, built-in security, and some basic management capabilities

Areas of improvement when moving to 4.0 of the .NET Framework 
 

Service tracingMonitoringDiagnosing running service instancesList all the WCF services that are configured in IISQuery the status of all the hosted servicesScale-out deployments or common WCF configuration tasks

Note that in the diagram below IIS plays a role and hosting a variety of services and frameworks. Workflow (WF) and WCF work hand to provide durable workflow services that can be monitored and administered, both through a visual interface with an IIS, and also a series of PowerShell command-lets that help administrators work effectively and scalable environments.

image

 

Here is the visual interface that we talked about earlier. It provides a simple dashboard to both monitor and administer WCF and workflow services.

 

image

 

More in the way of providing a method to gracefully update or change existing WCF Services. The toolin allows clients to receive the appropriate error messages during maintenance.

image

Always a challenge to update existing services

Once the application is offline, you can perform whatever updates are required.

When you are finished with the updates and are ready to bring the application back online again, you can then select the Restore Protocols command

The Windows PowerShell Disable-Application­MessageFlow and the Enable-Application­MessageFlow cmdlets can also be used to perform these same tasks from the command line.

Click here for PDC videos about WCF.