DevDays 2009 - MsForge

gayheadtibburInternet and Web Development

Feb 5, 2013 (4 years and 8 months ago)

231 views

{Energize}


your brain

Ivan
Pavlovi
ć,
Hive Studios

Visual C# MVP, MCSD, MCDBA, MCT

paki@hive
-
studios.com


http://msforge.net/blogs/paki


3

Modul

Trajanje

Raspored

Registracija

0
0
:15

09.
00



09
.
15

Uvod

Microsoft razvojna platforma

00:1
5

09
.
15



09
.
3
0

Microsoft

Platforma

Na putu ka servisima

01:
1
0

09
.
3
0


10
.
4
0

Pauza

0
0
:2
5

1
0
.
40



11
.
05

Kuda sa (ovim) podacima?

0
1:
30

11
.
05



12
.
35

Ručak

00:
45

12
.
35



13
.
2
0

Kako sa poslovnim zahtevima?

01:30

13
.
20



14
.
5
0

Pauza

00:25

14
.
50



15
.
15

A šta sa interfejsom?

01:30

1
5
.1
5



1
6
.4
5

Zaključak

00:
15

16
.4
5



1
7
.00

4

Communication +
Workflow + Services

"Dublin" Server Enhancements

Azure .NET Services

Software Factories

5

In the Cloud

On Premise

Data Layer

Access to

Back
-
end

Business

Layer

Composition

Composition

User Interface

& Interaction

Client & UI

.NET Framework

WCF, WF

Azure Services, .NET Framework

Windows Azure

Azure .NET Services

WCF

6

Interop

with other

platforms

ASMX

Managed

COM+

APIs

Enterprise
Services

WS
-
*

Protocol

Support

WSE

Message
-

Oriented

Programming

System.Messaging

Extensibility

Location
transparency

.NET
Remoting

7

A Service
Endpoint

has an Address, a Binding, and a Contract (ABC).

An
Address

is a network address indicates
where

the service is
located.

A
Binding

specifies
how

a client can communicate with the endpoint
including transport protocol, encoding, and security requirements.

A
Contract

identifies
what

operations are available to the clients.



Service

C

B

A

C

B

A

Client

A

B

C

Address


Where?

Contract


What?

Binding


How?

Endpoint

C

B

A

8

Every service is associated with a unique address.

Base address format


[transport]://[host name][:optional port]/[optional path]

Base

a
ddress describes where it provides the metadata for the
service (WSDL
)


Endpoint
address format


[base address]/[optional path]

Endpoint

address is where the service is actually listening. This
can be an absolute URI or relative to the base

address.


Build
-
in
transports: HTTP/S, TCP, P2P, IPC and MSMQ


Examples


http://localhost:8001/MyService/BP


http://localhost:8001/MyService/WS


net.tcp://localhost:8002/
MyService


net.pipe
://
localhost
/
MyPipe


net.msmq
://
localhost
/private/
MyQueue



10

Service Model Layer

Influences and adds to

the programming

model based on

incoming messages

Messaging Layer

Moves messages back

and forth and adds

transfer semantics

(channels)

Service

Code

Transaction
Behavior

CLR Type
Integration

Instancing
Behavior

Security

Channel

TCP
Transport

Security

Channel

TCP
Transport

Transaction
Behavior

CLR Type
Integration

11

Service Model Layer

Messaging Layer

Behaviors

Channels

Transaction
Behavior

CLR Type
Integration

Instancing
Behavior

Security

Channel

HTTP
Transport

Custom
Channel

Reliable
Messaging

Queue
Transport

MSMQ
Integration

TCP
Transport

Named
Pipes

Throttling
Behavior

Error
Handling
Behavior

Concurrency
Behavior

Metadata
Behavior

Custom
Behavior

HTTP
Transport

TCP
Transport

Security

Channel

Custom
Channel

Reliable
Messaging

CLR Type
Integration

Instancing
Behavior

Transaction
Behavior

12

Application

Messaging

TCP

Channel

HTTP

Channel

Queue

Channel

Secure

Channel

Reliable

Channel

Binary

Encoder

Text/XML

Encoder



Service

Model

Instance

Behavior

Throttling

Behavior

Type Integ.

Behavior

Transaction

Behavior

Concurrency

Behavior

Error

Behavior

Metadata

Behavior



Hosting

Environments

ASP.NET

WPF

WinForm

NT Service

COM+

WAS

13

Service

Describes the operations a service can perform.
Maps CLR types to WSDL.

Data

Defines data structures (complex types) that will
be sent on the wire. Maps CLR types to XSD.

Message

Defines the structure of the message on the wire.
Maps CLR messages to SOAP messages



ContractDescription

class represents WCF


Contract

Contract defines the operations of a
service


[ServiceContract]

public interface I
MyContract

{


[OperationContract]


string Hello(string name);

}


Implementing the service


public class
My
Service : I
MyContract

{


public string Hello(string name)


{


string
greeting

= "Hello " + name;


Console.WriteLine(
greeting
);


return
greeting
;


}

}






15

Manual hosting in any managed application

ASP.NET, COM+, EXE,
Windows

Service, Windows Forms,
WPF

Hosted in IIS

Windows
Activation Service

Used for hosting in IIS7 or outside IIS7

Windows Activation Service (WAS)

HTTP.SYS

TCP Transport
Listener

Named Pipes
Transport Listener

HTTP Listener
Adapter (IIS7)

NP Listener
Adapter

TCP Listener
Adapter

16

Increased
d
eveloper

productivity

Serialization, web prog. model, debugging

Support for syndication

Performance and scalability Improvements

IIS7 performance increase (5
-
10
×
)

Data platform support

Support for ADO.NET Entity Framework in
WCF services

WCF Tools improvements

Testclient, Config editor, Single
-
click publish


17

18

Host Process (.exe, IIS, "Dublin", Strata, …)

WF Runtime

Extensions

Tracking

Persistence



WF is a way to
coordinate work with
minimal ceremony


Activities

Runtime

Tooling


Tooling

VS
Designer

VS
Debugger

Rehosted

Designer

Workflow

Activity
Library

19

Coordinate Asynchronous (Distributed?)
Work

Write
Persistable

Applications

Customizable Vocabulary & Design
Experience

Gain Visibility into your Application







20

Activities are
composable

Activities execute in
pulses of work


which
can result in the
scheduling of other
activities

Sequence

Activity


State
Machine

Activity



Receive

Message

Activity



Delay

Activity



Assign

Activity


Send

Message

Activity



Activities are the
primitive abstraction for
behavior

WF Runtime

Execution, State Management, Persistence


21

Arguments
can be bound
to
Variables

up the parent
chain

Activities define arguments
to declare the type of data
that can flow into or out of
an Activity

Sequence



Receive

Message




Delay




Assign



InArgument
<object>

OutArgument
<object>

An Activity may contain
user
-
defined Variables for
data storage

Variables

Variables

WF Runtime

Execution, State Management, Persistence


State
Machine




Send

Message




InArgument
<
TimeSpan
>

OutArgument
<Message>

Variables

22

WCF 3.0


Independent
Technologies

WF 3.0

WF Rules 3.0


Workflow as
WCF Service


WF + WCF 4.0



Deep Integration


Unification of Activities and Rules


Fully Declarative Workflow
Services


Performance


Rich Workflow Host


Correlation

23

Activity Model & Runtime

Control Flow Activities

Flowchart

Sequential

State Machine

Rules

Custom Activities

<YOUR CODE HERE>

Base Activity Library

WCF
Messaging

Database

PowerShell

Error
Handling

Expressions

Interop

Utilities

WF
Primitives

BPEL

24

.svc

.
dll

.
xaml

.
config


WorkFlow

ServiceHost

.
cs

DataContracts

MessageContracts

ServiceContract

Workflow code

.
xaml

Workflow

Implementation

.
config


Bindings

Behaviors

24

25

.
xaml





Workflow
ServiceHost

.
xaml




Addresses

Bindings

Contracts

Workflow

Activities

Implementation

Behaviors




26

Developer / BA collaboration

Declarative expression

Application transparency

Custom tooling

Deployment flexibility


27

Activity

Usability (80% Code Reduction)

Alignment across Expressions, Rules, and Activities

Completely Fractal Composition Model

Fully declarative workflows and activities

Runtime

10
-
100X Performance Improvements

Integrates with App Models (WCF/WPF/ASP.NET)

Flow
-
in Transactions

Partial Trust Support

Full control over persistence

Tools

Designer Performance and Usability

Rehosting

Improvements

Unified Debugging Experience

And much
much

more….



28

29

Consider Workflow Services if your service
does any of the following:

Calls a database, Calls another service, or
Uses the File system

Coordinates parallel work

Coordinates messages with application state

Is long running

Requires rich tracking information

Prefer code services when your service

Is a set of independent operations w/ no
shared state


30

Workflow Service Host

Channel

XAML

Service

Dispatcher

Instance

Store

Workflow Runtime

Workflow

Instance

30

31

Service

Service

Service

Activity


Activity


Activity


Services

are the unit of
modularity for “loosely
-
coupled”
composition

Activities

are the unit of modularity
for “tightly
-
coupled” composition









32

Rest toolkit

Channels: UDP,
InProc

Standards: SOAP over UDP, WS
-
Discovery, WS
-
BA, BP 1.2

Standard Endpoints

Durable Duplex

Config



33

Prefer XAML

Think about designing models and storing models

in a repository/database

Build custom activities

Code won't port, custom activities will

Prefer WCF 3.5 send and receive

WCF/WF integration is even tighter Microsoft .NET 4.0

Use
WorkflowServiceHost

even when not
exposing workflows as services

NetNamedPipesBinding

34

In the Cloud

On Premise

Data Layer

Access to

Back
-
end

Business

Layer

Composition

Composition

User Interface

& Interaction

Client & UI

Azure
.NET
Services

Visual Studio Team System

Windows Server (“Dublin”)

Biztalk Server, SQL Server

35

Communication +
Workflow + Services

"Dublin" Server Enhancements

Azure .NET Services

Software Factories

36

Host for WF and WCF

Managabiltiy

Supportabilty

Scaleabily

Extensions to IIS/WAS



Windows Server

.NET Framework

“Dublin”

Visual
Studio

Oslo

WF and WCF
services

Administration Tools

System Center

IIS/WAS

37













38













Services and
Workflows



39

Partners

Runtime Services & Components

.NET Framework

Runtime Databases

(SQL / SQL Express)

Persistence schema

Monitoring schema

Hosting

Persistence

Monitoring

Management APIs (
PowerShell

command
-
lets)

IIS Manager

IIS/WAS

XAML &
Config

Activation

Service
Hosting
Environment

Auto
-
Start
Provider

Durable
Timer
Service

SQL
Persistenc
e
Provider

Instance
Control
Endpoint

Instance
Recovery
Service

Lock Retry
Behavior

Error
Handling
Behavior


WCF
Message
Logger

WCF
Analytic
Trace

WF
Tracking
Provider

Event
Collector

ETW
Tracking
Participant

Routing
(Forwarding
) Service

WCF and WF IIS Manager Modules

Visual Studio

Oslo

System Center

“Dublin” Management Pack

WCF and WF Templates

Dublin

Fx

Windows

40

Load
Balancer

Queue

Dublin

s1

s2

Dublin

s1

s2

Dublin

s1

s2

. . .

messages

data access

configuration & control

InetManager

PowerShell

InetManager

PowerShell

Via HTTPS to WMSVC

Via WS
-
MAN to
WinRM

41

Consolidated view of all Services on a
server

Easy export and import of Services

Integration into VS 2010

Various tracking profiles out of the box

Basic Workflow Tracking

Verbose WCF Service Tracking

Verbose Workflow Tracking

Custom tracking

42

Adds tooling to existing features

Powershell commands for all UI Elements

Tracing and Message Logging via easy user
interface (or Powershell)

Persisted Instance viewer

Running

Blocked

Ready
-
to
-
Run

Suspended




43

"Dublin" will not replace BizTalk

BizTalk will continue to be Microsoft's
Premier Integration Server

"Dublin" fits for

Scable, supportable, host for WF and WCF

Non
-
Integration solutions

Low mapping and adapter scenarios

Both clients with and without BizTalk Server

44

Post Visual Studios 10 (Mid 2010)

Available as a web download

Eventually baked into Windows

45

Communication +
Workflow + Services

"Dublin" Server Enhancements

Azure .NET Services

Software Factories

46



47

48

Access

Control

Workflow

Service

Bus

Support user identities securely across
different organizations

Model and execute business logic and
service interactions

Exchange messages between loosely
coupled, composite applications


Claims
-
based identity
management


Interoperable & based on
standard protocols (WS
-
Trust)


Manage through web page and/or
a services API


Supports
CardSpace
,
LiveID
,

U
sername/Password


Runtime execution environment
for XAML
-
based workflows


Enables the orchestration of
services


Extension of Windows Workflow
Foundation


XAML
-
based models can be
uploaded to the cloud


Simple publish
-
subscribe
eventing


Firewall

friendly messaging


Flexible connection modes


Connectivity to on
-
premises
applications to enable hybrid S+S
scenarios


Extension of Windows
Communication Foundation

Services for application integration

49

Key developer challenges

Want to make it easy and secure for partners
to use your application

Don’t always know the characteristics or scale
of the integration

Partners / customers / users have devices and
services running behind firewalls

Approach

Provide a high
-
scale, high
-
available “Service
Bus” that supports open Internet protocols

50

[
http|sb
]://servicebus.windows.net/services/account/svc/…

Root

servicebus
.

windows.

net

services

account

contoso



svc

Service Registry Root

Multi
-
Tenant

The service registry provides a
mapping from URIs to services

51

Two key capabilities

Relay

Direct connect

Relay

Ensure applications connect

Available to all via the service registry

Direct connect

Uses the relay to establish communication

Then shortcuts for efficiency

Available via HTTP / REST / ATOM

Available in .NET via WCF Bindings


52

53

54

55

Key developer challenges

Many identity providers, many vendors, many
protocols, complex semantics


tricky to get right

Application strewn with one
-
off access logic

Hard to get right, not agile, not compliant, many
dead ends

Approach

Automate federation for a wide
-
range of identity
providers and technologies

Factor the access control logic from the application
into manageable collection of rules

Easy
-
to
-
use framework that ensures correct token
processing



A portal at workflow.ex.azure.microsoft.com

New activities for the Azure Services Platform

APIs that allow you to deploy, manage, and run
your workflows on the cloud

Enables you to orchestrate services

Connect to services in your enterprise anywhere
on the Internet


uses the connectivity services

Give you partners and customer access


uses the
access control services


A reliable, scalable off
-
premises host for workflows

57

58

Communication +
Workflow + Services

Azure .NET Services

"Dublin" Server Enhancements

Software Factories

59

In the Cloud

On Premise

Application Modelling

Oslo & Quadrant

Identity Management

Live ID, Geneva Framework, AD Connector, .NET Services, Card Space

Integration Patterns & Security

Enterprise Service Bus, Internet Service Bus, WCF Security Guidance

Software Factories

Web Client Factory, Web Service Factory, Enterprise Library

60

A set of integrated tool, process and content
assets that accelerate rote and menial tasks
for a specific type of deliverable

May provide a partial implementation of a
prototypical deliverable containing key
mechanisms and design elements

A software factory contains (at least):

A schema that defines interrelated aspects
(viewpoints) of the deliverable life cycle

A template that configures a development
environment with the assets required by each
aspect (viewpoint
)

61

End
-
to
-
end guidance

That helps you develop solutions

Using proven practices (quality)

In a more consistent way (predictability)

In less time (productivity)

62

Create and enforce a consistent and
predictable way of developing, packaging,
and deploying business systems

Enforce architectural standards independent
of the solution domain.

Quickly expose architectural decisions and
risks

Create partial implementation of a solution
that includes the most critical mechanisms
and shared elements


63

Build upon a high
-
quality starting point
(baseline)

Easily apply guidance in consistent and
repeatable ways via Visual Studio automation

Benefit from patterns and practices directly in
Visual Studio

Focus on business logic, UI design, or
infrastructure services

Learn about the technology being used (for
example,
WCF


).

64

Ivan
Pavlovi
ć,
Hive Studios

Visual C# MVP, MCSD, MCDBA, MCT

paki@hive
-
studios.com


http://msforge.net/blogs/paki


88

©
200
9

Microsoft
Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademar
ks
and/or trademarks in the U.S. and/or other countries.

The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the
dat
e of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accu
rac
y of any information provided after the date of this presentation.

MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.