Return to Home Page
Overview
    History
    Acknowledgements
    Podcasts
    Notification Form
    Feedback Form
    Press Release #1
    Press Release #2
    Press Release #3

Master SOA Design
Pattern Catalog
    Master Pattern List (alphabetical)
    Master Pattern List (by category)
    Master Pattern List with
Page Numbers (PDF)
    Master Pattern List (Text)
    Pattern Notation
    Pattern Profiles
    Symbol Legend
    Pattern Contribution Form

SOA Candidate Patterns
    SOA Patterns Review Committee
    Candidate Patterns Overview
    Candidate Patterns List
    Candidate Pattern Contribution Form
    Candidate Pattern
Feedback Form
    SOA Pattern Template

Design Pattern Basics
    What's a Design Pattern?
    What's a Design Pattern Language?
    What's a Compound Pattern?

Supplemental
    SOA Patterns and Application Technologies
    SOA Design Patterns Historical Influences
    SOA Design Patterns and Design Principles
    SOA Design Patterns and Design Granularity
    Legal

Resources
    Design Patterns Publications
    Reference Posters
    SOAPrinciples.com
    WhatIsSOA.com
    SOA Visio Stencil

About the Book



SOA Design Patterns
by Thomas Erl

For more information visit: www.soapatterns.com

Related Publications


"Introducing SOA Design Patterns", SOA World Magazine (PDF)



"The Case for Single-Purpose Services: Understanding the Non-Agnostic Context and a Strategy for Implementation", SOA Magazine (HTML)



"REST-Inspired SOA Design Patterns", SOA Magazine (HTML)



"Service-Orientation and Object-Orientation Part I: A Comparison of Goals and Concepts", SOA Magazine (HTML)



"Service-Orientation and Object-Orientation Part II: A Comparison of Design Principles", SOA Magazine (HTML)



"Service Facade", InformIT (HTML)



"Non-Agnostic Context", InformIT (HTML)



"Domain Inventory", InformIT (HTML)



"Service Normalization", InformIT (HTML)



"Service Decomposition", InformIT (HTML)



"Canonical Schema", InformIT (HTML)



"Policy Centralization", InformIT (HTML)





Consumer-processed Composition (candidate)


Home > Candidate Patterns List > Consumer-processed Composition

How can business logic be executed with minimal impact on composition services?  

Problem

The orchestration of a service composition is driven by a composition controller service. This service forms a physical composition by invoking lower-layer service capabilities when its own capabilities are invoked.

The composition controller needs to retain or defer the state of the capability invocation until it has collected enough responses to return its own response to the consumer. The information from lower-layer responses also has little opportunity for caching on its way out to the service consumer once has been knitted together into a single response.

Solution

Execute the logic of the capability composition directly within the service consumer.

Application

Express the composition within the composition controller service in a definition that can be transferred to the service consumer.

Service consumers are able to process the definition with their own predefined logic. The consumer downloads a definition by invoking the service capability, and executes it locally.

The execution causes the service consumer to invoke further capabilities on lower-level services. Lower-level services may themselves be composition controllers whose own definition can be incorporated into the service consumer's processing.

Impacts

Composition controller service state and workload is minimized, and often such services can be reduced to simple file servers. Effectiveness of caching is improved by the finer granularity of information transferred to the end service consumer.

Service consumers are typically more loosely controlled, and may be less reliable than composition services in executing composition logic.

Service consumers must have direct access to lower-level services. Coupling can be formed between composition consumers and lower-level services referred to in the composition logic. Apply the Uniform Contract pattern to minimize coupling.

Composition definitions may inflexible if defined solely in terms of flat data. Flexibility can be improved by combining this pattern with code on demand.

Principles

Service Statelessness

Architecture

Inventory, Composition, Service

Status

Under Review

Contributors

Balasubramanian, Carlyle, Pautasso
 

A classical composition puts the workload onto the composition controller. The Service consumer invokes a capability on the composition service. The composition service invokes a series of capabilities on lower-layer services before returning a response to the service consumer:



A Consumer-processed Composition reduces load on composition controller services by processing the composition within the service consumer. The service consumer consults the composition service to load the appropriate composition definition. The definition instructs the service consumer on which service capabilities to invoke, and how to process the responses. These capabilities are invoked directly by the service consumer. Exposing underlying capabilities may improve opportunities for caching.



A full REST consumer-processed composition is able to follow links based on the Entity Linking, Uniform Contract, and Entity Endpoint patterns as well as those available directly in the composition definition. The service consumer looks up the composition service resource for instructions on how to print a label for invoice 1. The returned composition definition includes references to the invoice and to the label print queue, with instructions to fetch the invoice. Once returned, the invoice is found to include a reference to the customer which the composition definition indicates should also be retrieved. Retrieving the customer representation, reveals an address that is extracted and fed to the label print queue.


Related Patterns in This Catalog

Message-based State Deferral (Balasubramanian, Carlyle, Pautasso), Code On Demand (Balasubramanian, Carlyle, Pautasso), Entity Linking (Balasubramanian, Webber, Erl, Booth), Uniform Contract (Balasubramanian, Webber, Erl, Booth), Response Caching (Balasubramanian, Carlyle, Pautasso), Entity Endpoint (Balasubramanian, Carlyle, Pautasso)


Related Service-Oriented Computing Goals

Increased ROI, Increased Organizational Agility, Reduced IT Burden

The Prentice Hall Service-Oriented Computing Series from Thomas Erl
Home    SOA Books    SOA Magazine    What is SOA?    SOA Principles    SOASchool.com    SOA Glossary Copyright © 2007-2010
SOA Systems Inc.