+ All Categories
Home > Documents > NYCWCFFS - IntroToSOA&WCF

NYCWCFFS - IntroToSOA&WCF

Date post: 29-May-2018
Category:
Upload: roman-kalita
View: 217 times
Download: 0 times
Share this document with a friend

of 33

Transcript
  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    1/33

    Introduction To

    SOA & WCFMiguel A. Castro

    [email protected]

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    2/33

    i t

    Mig

    uel A. Castro

    .NET Architect, Developer, & Trainer

    Microsoft MVP

    ASP Insider VSX Insider

    Member of the INETA Speakers Bureau

    Conference Speaker

    In IT business since 1986

    ineta

    [email protected]

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    3/33

    AgendaAgenda

    Service Oriented Architecture

    What is WCF?

    Creating & Consuming Services

    Service Components Hosting Services

    Configuration

    Best Practices

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    4/33

    Service Oriented ArchitectureService Oriented Architecture

    The decomposition of a

    system into autonomous,

    discoverable, and secureunits of responsibility and the

    interoperable exposure ofsaid units.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    5/33

    For a very cool T-Shirt:For a very cool T-Shirt:

    Where is that definition from?

    A. Martin Fowlers Patterns of Enterprise

    Architecture

    B. Microsoft Patterns & Practices SOA Guidelines

    C. I made it up myself

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    6/33

    Service Oriented ArchitectureService Oriented Architecture

    SOA separates applications into services.

    Services are orchestrators into down-levelbusiness layers.

    Allows connectivity of dissimilar technologies. Is NOT a product. It is an architecture and designparadigm.

    Next evolution of programming paradigms.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    7/33

    Programming ParadigmsProgramming Paradigms

    Applications were developed by continuously calling functions

    that housed various areas of functionality.

    Problems:

    No reuse outside of application.

    No design analogy to real-world made for

    cumbersome development process.

    Procedural ProgrammingProcedural Programming

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    8/33

    Programming ParadigmsProgramming Paradigms

    Applications were built by working with

    various entities that resembled real-worldcounterparts, housing both data and

    behavior.

    Problems:

    No reuse outside of application.

    Required lots of plumbing formanaging ancillary functionality

    (reliability, transactions, security, etc.).

    Object Oriented ProgrammingObject Oriented ProgrammingApplicatio ns were developed by continuously callingfunctions that housed various areas of functionality.

    Problems: No reuse outside of application. No design analogy to real-world made forcumbersome development process.

    Procedural ProgrammingProcedural Programming

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    9/33

    Programming ParadigmsProgramming Paradigms

    Objects could now be encapsulated and

    managed by a common abstraction layer(COM) and housed in separate libraries

    (DLLs).

    Problems:

    Ancillary functionality typically required

    external service management(MTS, COM+, Corba).

    Component Oriented ProgrammingComponent Oriented Programming

    Applicatio ns were developed by continuously callingfunctions that housed various areas of functionality.

    Problems: No reuse outside of application. No design analogy to real-world made forcumbersome development process.

    Procedural ProgrammingProcedural Programming

    Applications were built byworking with various entities thatresembled real-worldcounterparts, housing both dataand behavior.

    Problems: No reuse outside of application. Required lots of plumbing for

    managing ancillaryfunctionality (reliability,transactions, security, etc.).

    Object Oriented ProgrammingObject Oriented Programming

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    10/33

    Programming ParadigmsProgramming Paradigms

    Objects are managed and encapsulated

    within autonomous services, each with its

    own set of responsibilities.

    Problems:

    Needs a good glue technology to

    handle cumbersome plumbing for

    ancillary technologies. Requires a technology that

    accommodates interoperability.

    Service Oriented ProgrammingService Oriented ProgrammingApplicatio ns were developed by continuously callingfunctions that housed various areas of functionality.

    Problems: No reuse outside of application. No design analogy to real-world made forcumbersome development process.

    Procedural ProgrammingProcedural Programming

    Applications were built byworking with various entities thatresembled real-worldcounterparts, housing both dataand behavior.

    Problems: No reuse outside of application. Required lots of plumbing formanaging ancillary

    functionality (reliability,transactions, security, etc.).

    Object Oriented ProgrammingObject Oriented Programming

    Objects could now be encapsulatedand managed by a commonabstraction layer (COM) and housed inseparate libraries (DLLs).

    Problems: Ancillary functionality typicallyrequired external servicemanagement (MTS, COM+, Corba).

    Component OrientedProgrammingComponent OrientedProgramming

    Enter WCF !

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    11/33

    Service Oriented ArchitectureService Oriented Architecture

    It is NOT a replacement for Components orObjects.

    Usually incorporate object-oriented enginesbehind a service.

    Will not help you fix bad architecture practices.

    Mistakes can still be made behind a service wall

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    12/33

    Service Oriented ArchitectureService Oriented Architecture

    Client Tier(Desktop Applications,

    Unmanned Processes)

    Database Tier

    Data Access Layer

    Presentation Tier - (Web Browser)

    UI (Client) Tier (IIS)

    Data Access Layer

    Database Tier

    Service Layer

    Business Client Layer(Service Proxies)

    Client

    Desktops or

    Browser

    applications

    Business

    Service Layercommuni-

    cates with

    Business

    Client Layer

    Business/ORM Engine Business/ORM Engine

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    13/33

    Service Oriented ArchitectureService Oriented Architecture

    What is a service?

    Encapsulated units of responsibility.

    Atomic

    Durable Secure

    Always leave a system in a consistent state

    Services are rock-solid at handing their unit of

    responsibility. Services are typically an orchestration layer atop

    one or more fine-grain business engines.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    14/33

    Enter WCFEnter WCF

    Windows Communication Foundation

    The artist formerly known as Indigo

    Provide a unified communication model.

    Web Services Remoting

    Sockets

    Enterprise Services

    MSMQ

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    15/33

    Enter WCFEnter WCF

    Enforces an SOA approach.

    More than ASMX anyway.

    Provides a declarative and pseudo-aspect-oriented model for managing functionality.

    Transactions

    Security

    Durability

    Etc. Provides ability to concentrate on service logic

    Despite transport

    Not always the case (i.e. MSMQ & REST)

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    16/33

    WCF BreakdownWCF Breakdown

    System.ServiceModel

    Assembly & Namespace

    Data Contracts

    Service Contracts Services

    Service Host

    Client Proxy

    Configuration

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    17/33

    Service ContractsService Contracts

    Interfaces that define service operations whichwork with single types or data contracts.

    Interface decorated with [ServiceContract]

    Operations decorated with[OperationContract]

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    18/33

    Data ContractsData Contracts

    Defines the data that is to be received and/orreturned by a service.

    Not necessary if said data are single types.

    Must be serializable using the new[DataContract].

    System.Runtime.Serialization

    Opt-In serializer

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    19/33

    Service ClassesService Classes

    Classes that provide the service implementation.

    Can implement one or more service contract.

    Implementation includes anything necessary tobuild and return the data contract.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    20/33

    Service HostingService Hosting

    Can take three shapes:

    IIS

    Self-Hosting

    WAS

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    21/33

    Service HostingService Hosting

    IIS can host only HTTP services.

    Self-Hosting can be ANY application.

    WAS can host any protocol.

    Uses IIS for administration. Available in Vista and Server 2008

    Create the contracts, service, and self-host

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    22/33

    Configuring Your ServiceConfiguring Your Service

    {endpoint goes here}

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    23/33

    Endpoint ConfigurationEndpoint Configuration

    config section.

    The ABCs or WCF

    address

    Defines where clients can find your service. binding

    Defines the transport protocol.

    contract

    Defines what operations service will expose.

    Configure the host

    This defines the

    services

    EndPoint

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    24/33

    Accessing the ServiceAccessing the Service

    Clients communicate by way of a proxy class.

    Proxy class opens channel to service.

    Makes calls to service operations.

    Proxy expects to find client configuration. Can also be done programmatically.

    Proxies need access to the service contracts anddata contracts.

    NOT the services themselves.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    25/33

    Proxy ClassesProxy Classes

    Derivative ofSystem.ServiceModel.ClientBase

    T is the service contract interface.

    Class also implements the service contract.

    Methods make similar calls to methods ofChannel.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    26/33

    Configuring Your ClientConfiguring Your Client

    {endpoint goes here}

    Create proxies, client, and configure client

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    27/33

    Choosing a BindingChoosing a Binding

    InsideFirewall

    and .NET-.NET?

    LocalOnly?

    NetTcp

    Binding

    NetMsmq

    Binding

    Need to

    Disconnect?

    NetNamedPipe

    Binding

    Support

    Legacy?

    WsHttp

    Binding

    BasicHttp

    Binding

    YES NO

    YES

    YES

    YES

    NO

    NO

    NO

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    28/33

    Additional TechnologiesAdditional Technologies

    Transactions

    Throttling

    Instancing

    Concurrency Tracing & Logging

    Queuing

    Version Tolerance

    Callbacks

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    29/33

    Benefits of WCF ServicesBenefits of WCF Services

    All WCF-based classes (services) benefit from:

    Encrypted Calls

    Authentication

    Identity Propagation Authorization

    Security Audits

    Transaction Propagation

    Transaction Voting

    Call Timeout

    Reliability Tracing

    Logging

    Instance Management

    Durability

    Error Masking

    Fault Isolation Channel Faulting

    Buffering

    Throttling

    Versioning

    Synchronization

    Remotability Interoperability

    Queuing

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    30/33

    Benefits to SOABenefits to SOA

    Location independence

    Interoperability across platforms

    API-like development paradigm

    Better organization than object distribution Loose Coupling

    Services exposed across the enterprise

    Security

    With WCF, lots of feature from which to benefit

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    31/33

    SummarySummary

    WCF provides a unified and robust model fordeveloping service oriented applications.

    The WCF runtime provides further managementof classes written in regular C#/VB.

    WCF encapsulates classes and provides manyenterprise management features

    WCF enforces SOA.

    Binding options provide many levels ofaccessibility and security.

    Hosting options allow for many creativescenarios.

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    32/33

    ReferencesReferences

    Learning WCF

    OReiley - Michele Lereux-Bustamante (IDesign)

    Programming WCF

    OReiley - Juval Lowi(IDesign)

    Pro WCF Apress - Chris Peiris & Dennis Mulder

    Essential WCF

    Addison-Wesley Chris Bowen, et. al.

    IDesign WCF Master Class www.idesign.net

  • 8/9/2019 NYCWCFFS - IntroToSOA&WCF

    33/33


Recommended