Implementing Services and Business Processes using WCF and WF - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Implementing Services and Business Processes using WCF and WF

Description:

It is a new breed of communications infrastructure built around the Web services ... Unified model for human and system workflow scenarios ... – PowerPoint PPT presentation

Number of Views:112
Avg rating:3.0/5.0
Slides: 42
Provided by: nenadj
Category:

less

Transcript and Presenter's Notes

Title: Implementing Services and Business Processes using WCF and WF


1
Implementing Services and Business
Processesusing WCF and WF
  • Nenad Jovicic, B.Sc.Program Manager, Pexim
    Solutionsnenad.jovicic_at_pexim.co.yu

2
Agenda
  • SOA
  • WCF Fundamentals
  • WCF Demo
  • WF
  • WF Demo
  • WF and WCF integration in Visual Studio 2008
  • WF WCF integration demo
  • Summary
  • QA

3
Services
  • A service is a program you interact with via
    message exchanges
  • Service implements business functionality
  • Services are built to last
  • Availability and stability are critical

4
What is Service Orientation?
  • Service Orientation is an approach to building
    systems using autonomous services which adhere to
    the 4 Principles of Service Orientation
  • Boundaries are Explicit
  • Services are Autonomous
  • Services share schema and contract, not class
  • Service compatibility is determined based on
    policy

5
Service Design Key Concepts
Services
6
Web Services ArchitectureRoadmap
Connected Applications
Security
Reliable Messaging
Transactions
Metadata
Messaging
XML
Transports
7
WCF Fundamentals
  • Today we develop distributed systems with big
    number of different technologies
  • ASMX, .Net Remoting, Message Queueing, Enterprise
    services, WSE
  • Software is connected and building connected
    systems is hard
  • WCF simplifies development of connected systems

8
WCF helps you
  • You are typical husband with big problem
  • Save your money and make your wife happy
  • One shoe for all occasions

9
Unified programming model
.NET Remoting
ASMX
Interop with other platforms
Extensibility Location transparency
Attribute- Based Programming
Message- Oriented Programming
WS- Protocol Support
Enterprise Services
System.Messaging
WSE
10
WCF
  • Windows Communication Foundation - formerly
    code-named "Indigo
  • Connected systems platform for Windows
  • It is a new breed of communications
    infrastructure built around the Web services
    architecture
  • Windows Communication Foundation unifies a broad
    array of distributed systems capabilities in a
    composable and extensible architecture, spanning
    transports, security systems, messaging patterns,
    encodings, network topologies, and hosting
    models.
  • Microsoft's unified programming model for
    building service-oriented applications

11
WCF Architecture
Client
Service
Bv
Bv
Message
Bv
Bv
Address
Binding
Contract
(Where)
(How)
(What)
12
ABC of Indigo
13
ABC of Indigo
  • Contract can support many bindings and binding
    can support many contracts
  • Service can have more endpoints ( published
    contracts on address) at the same time
  • HTTP, interoperability
  • TCP, performances
  • Contract can have specific binding requests like
    security, transaction flow, etc.
  • If binding does not satisfy contract requirements
    it will not be started

14
Decide which binding to use
  • Bindings Transports Encoders Protocols
  • Transports ( HTTP, TCP, Named Pipes, MSMQ, Peer
    Transport )
  • Encoding
  • Text (for interoperability)
  • Binary ( for hi-speed Indigo-to-Indigo )
  • MTOM (Message Transmission Optimization Protocol
  • for incorporating binary attachments )
  • Protocols (WS-Security, WS-Reliable Messaging,
    WS-Coordination and Transaction)

15
Binding table
16
WCF implements WS-
  • Security
  • Transactions
  • Reliable messaging
  • Metadata

17
Security credentials
  • Message Credentials
  • Security requirements satisfied atmessage layer
  • Claims carried in messages
  • More credential types, extensible
  • Transport Credentials
  • Security requirements satisfied attransport
    layer
  • Performance benefits
  • Restricted claim types

18
Defining Service
  • Using System.ServiceModel
  • ServiceContract
  • interface IArrangementManagement
  • OperationContract
  • void Save(ArrangementRq request)

19
WCF demo
20
Fundamentals - What is Workflow?
A set of activities that coordinate people and /
or software...
EscalateToManager
CheckInventory
Example activities.
organized into a workflow.
21
Windows Workflow Foundation
Extensible framework and tools for building
workflow into Windows applications
  • Single workflow technology for Microsoft
    products, partners and customers
  • A framework to build on not a server or
    application
  • Key features
  • Enables long running workflows in any application
    or server
  • Extensible activity framework
  • Unified model for human and system workflow
    scenarios
  • Visual designer for graphical and code-based
    authoring
  • Availability
  • Exposed via .Net 3.5 and VS 2008

22
Why Workflow Technology?
23
Windows Workflow Foundation
Visual Designer
  • Key Concepts
  • Workflows are a set of Activities

A Workflow
  • Workflows run within a Host Process any
    application or server
  • Developers can build their own Custom Activity
    Libraries

An Activity
Custom Activity Library
Components
  • Base Activity Library Out-of-box activities and
    base for custom activities

Windows Workflow Foundation
  • Runtime Engine Workflow execution and state
    management

Base Activity Library
  • Runtime Services Hosting flexibility and
    communication

Runtime Engine
  • Visual Designer Graphical and code-based
    construction
  • Rules Engine Enables declarative, rule-based
    development for workflows and any .NET
    application to use.

Runtime Services
Host Process
24
Workflow Basics
  • A workflow is a class, designer generated

public sealed partial class MyWorkflowSequentialW
orkflowActivity public MyWorkflow() Initia
lizeComponent()
  • A workflow class may be defined in markup

lt?Mapping XmlNamespace"Activities"
ClrNamespace"System.Workflow.Activities"
Assembly"System.Workflow.Activities"
?gt ltSequentialWorkflow xClass"MyWorkflow"
xmlns"Activities" xmlnsx"Definition"gt
lt/SequentialWorkflowgt
25
Workflow Authoring Modes
Markup and Code
Application Generated
Markup Only Declarative
Code Only
App creates activity tree and serializes

XAML
XAML
  • Code creates
  • workflow
  • in constructor
  • XML defines
  • workflow
  • Code-beside
  • defines extra logic
  • XML defines
  • workflow structure
  • logic and data flow

XAML
Workflow Compiler wfc.exe
  • .NET assembly
  • ctor defines
  • workflow

C/VB Compiler
26
Custom Activities
  • Activities are the building blocks of workflows
  • The unit of execution, re-use and composition
  • Basic activities are steps within a workflow
  • Composite activities contains other activities
    EG Sequence
  • Base Activity Library provides out-of-the-box
    activity set
  • Partners and customers author custom activities
    EG ExecutePaymentOrder

27
Custom Activities
  • Activities are classes
  • Properties and events are defined by the activity
    author and programmable from workflows
  • Has methods that are coded by the activity author
    but invoked by the workflow runtime (EG Execute)
    or designer
  • Can be built into workflow assemblies or deployed
    as re-usable libraries

28
Example A SendMail Activity
using System.Workflow.ComponentModel public
partial class SendMail System.Workflow.Component
Model.Activity public SendMail()
InitializeComponent() protected override
Status Execute(ActivityExecutionContext context)
// my logic here to send the
email return Status.Closed public
partial class SendMail public string
subject public string Subject get return
subject set this.subject value
private void InitializeComponent() // designer
generated this.ID "SendMail"

29
Activities An Extensible Approach
Base Activity Library
Custom Activity Libraries
Out-of-Box Activities
  • OOB activities, workflow types,
  • base types
  • General-purpose
  • Activity libraries
  • define workflow
  • constructs
  • Create/Extend/ Compose activities
  • App-specific building blocks
  • First-class citizens

30
Base Activity Library
System Workflow
Human Workflow
Base Activity Library
Workflow Styles
State Machine Workflow
Sequential Workflow
Sequential Control
Rules-Driven
Transactions
Out-of-box Activities
Communications Local and Web Services
Activity Framework
Base Classes and Behaviors Dynamic Update
Exceptions Transactions
31
Runtime Engine And Services
My workflow
Windows Workflow Foundation
  • Base Activity Library

Host Process
32
Developer Ecosystem
Workflow Developers
Minimal coding, full authoring environment
Application
Workflows
Flow Logic
Host Developers
Application services host
Custom Activities
WWF Runtime
Services
Custom Services
Activity Developers
Custom execution validation logic
33
Runtime Services
Host Application
App Domain
Runtime
Services
TimerService manages timers e.g. Delay activity.
Out of Box Services are provided that support SQL
Server
TimerService
PersistenceService stores and retrieves instance
state.
SQL
PersistenceService
TrackingService
TrackingService manages profiles and stores
tracked information.
ThreadingService
TransactionService
Common resource services for managing threading
and creating transactions
34
WF Demo
35
WF and WCF integration inVisual Studio 2008
  • Workflow Foundation does not provide a default
    hosting environment
  • WorkflowServiceHost is a service-oriented hosting
    environment for Workflows
  • ServiceContracts provide strongly-typed
    programming model for interacting with a Workflow
  • Host uses messaging to interact with Workflow
  • Workflow uses messaging to interact with host

36
Workflow Service Architecture
Workflow.cs or Workflow.xoml
Workflow Runtime
WorkflowOperationInvoker
App.config
ServiceHost
Workflow ServiceHost
DurableInstanceProvider
MessageContextInspector
ContextChannel
ListenerChannel
37
WF WCF integration
38
Summary
  • Service and business processes can be easily
    developed using WCF and WF
  • WCF implements WS-
  • Business Activity library can be easily developed
    using WF
  • WF and WCF are integrated in VS 2008

39
Resources
  • http//netfx3.com/

40
QA
  • Its time for challenge www.pexim.net/ucc2008
  • Prize?

41
Prikljuci se na msforge.net !!!Microsoft Forge
Zajednica i User Grupa
Druenje, forum, blogovi. Mesto okupljanja za
sve Windows, .NET iSQL Server fanove.
Write a Comment
User Comments (0)
About PowerShow.com