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 (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


Content Negotiation (Balasubramanian, Booth, Erl, Riley)


Home > Candidate Patterns List >Endpoint Redirection

How can a service capability accommodate service consumers with different media type requirements?  

Problem

Different service consumers may have differing media type requirements for the data provided by a given service capability.

Solution

Allow alternative representations of the data to be returned by the same service capability, and use metadata in each request message to select the most appropriate representation for the corresponding response message.

Application

This pattern can be relevant to a broad range of scenarios. For example, legacy service consumers may only understand an older media type in response to messages or may only be able to generate an older media type for use in requests. Mobile service consumers may require content tailored for smaller screens and lower bandwidth.

Decouple the data's media type from the service capability by introducing a generic representation envelope that can include arbitrary types of data.

Either include metadata at appropriate levels of abstraction in request messages to determine which representation to return in responses, or when multiple representations are available, return a response that indicates to the consumer how to request each specific alternative representation.

State the media type of data within request and response messages to ensure that the correct parser can be chosen by the message recipient.

Impacts

Fewer service capabilities are needed to accommodate variation in service consumer requirements. Services are able to support old and new service consumers as well as other variations concurrently using the same service capabilities.

The complexity of cache implementations is increased, and requires that caching metadata indicate what metadata input to each request may affect which representation will be returned.

Metadata included in requests can increase bandwidth requirements and reduce performance. Requesting metadata that is not abstract enough can introduce consumer to service implementation coupling.

Principles

Standardized Service Contract, Service Loose Coupling

Architecture

Composition, Service
 
The service contract accepts and returns different types of content to accommodate the needs of different service consumers. Incorporating content negotiation into a reusable service contract allows a service to be compatible with old and new consumers and to accommodate other variations without introducing new service capabilities to the contract.


Related Patterns in This Catalog

Compatible Change (Orchard, Riley), Concurrent Contracts (Erl), Lightweight Endpoint (Balasubramanian, Carlyle, Pautasso), Schema Centralization (Erl)



Related Service-Oriented Computing Goals

Increased Organizational Agility, Reduced IT Burden

SOA with REST This page contains excerpts from:

SOA with REST: Principles, Patterns & Constraints
by Raj Balasubramanian, Benjamin Carlyle, Thomas Erl, Cesare Pautasso





(ISBN: 0137012510, Hardcover, 400+ pages)

For more information about this book, visit
www.soabooks.com.
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-2011
SOA Systems Inc.