WCF and WPF - CA 2E/Plex Conference

72 downloads 91 Views 3MB Size Report
25 Sep 2009 ... Mi ft NET WCF. Microsoft .NET - WCF and WPF. L. M d. Larry Mead. Microsoft Corporation. Co-branded Logo Footprint. Aligned LEFT ON ...
Microsoft Mi ft .NET NET - WCF and WPF

L Larry Mead M d Microsoft Corporation

Co-branded Logo Footprint Aligned LEFT ON COVER ONLY Must Fit Within This Space

Agenda > Session overview > Introducing the WCF Basic Concepts  Demo

> Diving Di ing into the WCF A Architecture chitect e  Demo

> Introducing I t d i WPF  Demo

> WPF Graphics G hi  Demo

> Summary Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Session Overview

> .NET is more than C#, VB.NET and the CLR  .NET also includes tools for system development

> This session is not an overview of .NET  This session is an overview of the Windows Communication Foundation (WCF) and Windows Presentation Foundation (WPF)

3

September 23-25, 2009

Copyright © 2009 CA. All rights reserved.

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Why WCF - The Connectivity Imperative

> Interoperability & Integration > Secure, Reliable, Transacted Messaging > Decoupled, Decoupled Dynamic Applications

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

What is WCF? > Unified framework for building interoperable service-oriented applications on the Windows platform l f > Platform Support and Availability Windows XP

Windows Vista & Server Windows 7 2003

Windows Server 2008 & R2

Installs with Operating System Available as a separate t download Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

What are the key WCF drivers? 

Productivity  

Interoperability

 

Service Oriented Development

  



Web Programming

Unifies today’s distributed technology stacks Integration with Visual Studio 2005 and 2008 Appropriate for use on-machine, cross machine, and cross Internet C Cross-platform l tf interoperability i t bilit (WS*) Integration with existing Microsoft technologies Service-oriented programming model Supports 4 tenets of serviceorientation Maximized productivity for building SOAs web scenarios  1st class support for REST, REST RSS/ATOM, JSON Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Introducing g WCF

7

September 23-25, 2009

Copyright © 2009 CA. All rights reserved.

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Unification of Programming Models

ASMX & WSE

.NET Remoting

Interop with other Platforms & WSWS-*

Extensibility Location ttransparency

AttributeAttributeBased Programming Enterprise Services

REST / HTTP Programming

MessageMessageOriented Programming System.Messaging

HTTP Services (*) New in .NET 3.5

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WS* Protocol Framework Interoperability through open standards

Reliable Delivery

Transactions

M Messaging i XML Transports

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Metada ata

Security

WCF Basic Principles > Developers write services that respond to messages  WCF services i execute t iinside id th the CLR  WCF messages use SOAP model  Services expose addressable endpoints

> Services implement contracts that describe messages being b g exchanged a g d  Individual contracts are either structural (schema) or behavioral (interface)  Contracts constrain message flow between initiator and service

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Address Binding Contract

Address

(Where)

(How)

> Makes an EndPoint uniquely addressable > Uri based  http://localhost/myservice  net.tcp//localhost/myservice //l lh /

> Base address + relative path for each EP  http://localhost/myservice  http://localhost/myservice/ep1  http://localhost/myservice/ep2

> Normally configured by the Administrator

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

(What)

Bindings

Address Binding Contract (Where)

(How)

(What)

> Bindings determine ‘how’ an endpoint is accessible  Configure C fi th the WCF Communication C i ti IInfrastructure f t t  Transport, Encoding and (WS*) Protocols

> WCF publishes bli h binding bi di configuration fi ti th through h metadata t d t > Bindings are normally specified in configuration  Can be specified in code as well

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Contracts

Address Binding Contract (Where)

(How)

(What)

> Contracts describe the external view of a service > Contracts are exposed through WSDL and XSD > Contracts are explicitly defined, opt-in model WCF Service CLR types



Contrac cts

Interface

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Implementation

Types of Contracts > Service Contract  Defines the operations of a service  Each operation defines a Message Exchange Pattern (MEP) – OneWay, Request/Reply and Duplex

> Data Contract  Structural “schemas” for data representations

> Fault Contract  Defines errors/faults that a service may return so that consumer applications can handle these situations more gracefully

> Message g Contract  Controls SOAP processing/data model Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Metadata > Describes the capabilities of a service > Metadata consists of contracts (XSD, WSDL) and Policy > Metadata can be published through:  HTTP Get (baseaddress?wsdl)  WS-Metadata Exchange (MEX) – MEX is a SOAP based b d protocoll ffor exchanging h metadata d

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Behaviors > Behaviors determine the local client and service behavior > Behaviors can be applied through code and configuration > Developer vs. Administrator behaviors Behavior

Description

Instancing

Specifies the number of instances of services available for handling a message

Concurrency

Determines if a service supports single-threaded or multi-threaded modes of operation

Throttling

Determines the maximum number of simultaneous requests, connections, i service i instances, i pending di operations

Exception Handling

Determine how exceptions are handled

Security (Impersonations, Authorization), Local Transactions, custom, etc. Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WCF Architecture

Client Behavior Behavior Behavior

Application Logic

Service Behavior

Service Model Layer (Integration + local Service behavior)

Behavior Behavior

Channel Channel E Encoder d Transport Channel

Channel

Messaging Layer (Messaging Infrastructure)

Channel E Encoder d Transport Channel

Note: Configured through Bindings Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WCF Scenarios

18

September 23-25, 2009

Copyright © 2009 CA. All rights reserved.

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WCF Capabilities

Security, Reliable Communication and Transaction > Security

 Secure,, simple p and interoperable p  Support for Message (WS*) and Transport level security – Authentication, Authorization, Transfer security

> Reliable Messaging

 WCF provides reliable communication over unreliable infrastructure – SOAP based reliable sessions for connected communication – MSMQ based reliability for disconnected communication

> Transactions

 Transactions ensure Consistency  WCF Transaction Scenarios – Perform an Service Operation as a single transaction – Flowing transactions across services Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

.NET NET 3.0 30

Integration with IIS and WAS to enable •



WCF activation over http and non-http transports management of services

.NET NET 3.5 35

Hosting WCF ser ice in Partial service Trust • Activation of XOML services



.NET NET 4.0 40

Activation of XAMLX services ser ices • Config based Activation • Default configuration model • Activate over multiple http base address • Autostart • System.web System web Integration •

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Windows Presentation Foundation

A productive, unified approach to UI, media and documents to deliver unmatched user experience

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WPF Key Scenarios

Next--Gen Windows Smart Client applications: Next pp

> Installed I t ll d desktop d kt applications li ti

> Browser applications (XAML Browser Application)

> Common code base and flexible deployment

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Declarative Programming Through XAML

XAML = Extensible Application Markup Language • Easily toolable, declarative markup • Code and content are separate • Can be rendered in the browser/application

XAML OK LightBlue

C# Button b1 = new Button(); b1.Content = "OK"; b1.Background = new SolidColorBrush(Colors.LightBlue ); b1.Width = 100;

VB.NET Dim b1 As New Button b1.Content = "OK" b1.Background = New _ SolidColorBrush(Colors.LightBlue ) b1.Width = 100

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Introducing g WPF

24

September 23-25, 2009

Copyright © 2009 CA. All rights reserved.

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Controls, Templates, Styles & Resources, Layouts, Animation Animation, Triggers, Timelines

Templated Button

UI Services •

Templates p • Layout

• Controls Library • Styles and Resources • Annotation

... … remainder of contents of StackPanel, including x:Name'd TheBrush and LowerEllipseTransform … / k l

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Data Binding Binding Target

Binding Source

Dependency Object

Object

Dependency Property

OneWay TwoWay

Property

OneWayToSource

Layout & Databinding Select A Customer UI can be bound to CLR objects and XML > Dependency properties can also be bound to ADO.NET and objects associated with Web Services and Web properties > Sort, filter, and group views can be generated on top of the data > Data templates can be applied to data Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

2D Graphics, 3D Graphics, Imaging

3D Graphics

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

WPF Graphics p

28

September 23-25, 2009

Copyright © 2009 CA. All rights reserved.

Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space

Summary > WCF is an unified framework for building service-oriented applications on the Windows platform  WCF achieves unification via a composable architecture g secure and reliable distributed  Rich foundation for building systems  Easy integration and migration path for existing applications

> WPF is a declarative presentation framework for both rich client and browser user interface  Supports the latest Vista and Windows 7 glass  Supports 2D and 3D graphics  Includes support of latest Office and Windows tools Co-branded Logo Footprint Aligned Right Edge Must Fit Within This Space