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


Reusable Contract (candidate)


Home > Candidate Patterns List > Reusable Contract

How can multi-purpose service logic be made effectively consumable
and composable? How can service consumers compose services
without having to couple themselves to service-specific contracts?
 

Problem

To access a service capability of a service with a service-specific contract, the service consumer must be designed to couple itself to the service contract. When the service contract changes, the service consumer is no longer functional. To access a new version of the service contract or to access other service contracts in order to compose other services the service consumer must be subjected to additional development cycles, thereby adding incurring time, effort, and expense.

Solution

Expose the service capabilities via a common, reusable technical service contract that provides a set of abstract, multi-purpose methods that allow service-specific capability logic to be chosen at runtime. The service consumer can be designed to use a specific service capability or can discover the service capability at runtime. The reusable service contract defines only high-level data exchange requirements via each abstract method. This way, the logic that invokes the generic method does not need to be modified.

Application

A reusable service contract can provide abstract and agnostic data exchange methods, none of which are related to a specific business function. Methods within a reusable contract are typically focused on types of information rather than on the business context of the information.

Whatever context is established by a reusable contract method reappears within and forms part of an individual service capability. A service consumer selects the correct capability at runtime and this selection provides the business context for the invocation of the reusable contract method.

HTTP provides a reusable contract via common methods, such as GET, PUT, and UPDATE, which allow consumer programs to access Web-based resources by further providing resource identifiers. The combination of the resource identifier and the HTTP method can comprise a service capability.

Impacts

Sharing the same contract across services increases the importance of getting the contract right both initially, and over the contract lifetime. Reusable contracts can therefore require increased governance effort compared to service-specific contracts.

The reusable contract may still need to change if new services with new high-level data exchange requirements are introduced into the service inventory. The most valuable contracts have many orders of magnitude with more services using the contract than there are versions of the contract.

The reusable contract can lack sufficient metadata to effectively enable a service to be discovered. Service-specific metadata may need to be maintained separately from the reusable contract definition to ensure that service consumers are able to select the correct service capability with which to interact.

Principles

Standardized Service Contract, Service Loose Coupling, Service Abstraction, Service Reusability, Discoverability, Service Composability

Architecture

Inventory, Composition, Service
 
In this example, the reusable contract introduces an overarching business context of Tax Rules. The method exposed by the reusable contract further specifies this context as calculateTaxes. The resulting service capabilities inherent this context and combine it with their own identifiers. The result is three service capabilities that can be read as "calculate taxes for the US," "calculate taxes for the UK," and "calculate taxes for a future jurisdiction."

Related Patterns in This Catalog

Canonical Expression (Erl), Lightweight Endpoint (Balasubramanian, Carlyle, Pautasso), Schema Centralization (Erl), Service Facade (Erl), Uniform Contract (Erl),


Related Service-Oriented Computing Goals

Increased Intrinsic Interoperability, Increased Business and Technology Alignment, Increased ROI, 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.