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


Decoupled Validation Logic (Balasubramanian, Carlyle, Pautasso)


Home > Candidate Patterns List >Decoupled Validation Logic

How can a service designed to validate an input document avoid rejecting future versions of the media type?  

Problem

Service consumers often need to validate documents received as part of response messages against a pre-defined schema. However, strict validation logic can inadvertently reject messages to which new versions of a media type are applied.

Solution

The validation logic is physically decoupled from the service logic. Explicit extension points are used where parsers ignore media types that need to support new message content.

Application

Media types support explicit extension points where old parsers must ignore new content they do not understand. When the new version of a media type is defined, the new information is added with the understanding that old processors will ignore it and will need to rely on the old information.

New validation logic replaces the old logic when a new media type version is introduced. This replacement occurs automatically without modifying other service or message-processing logic within services and consumers. The mix of new validation logic and old processing logic will strictly validate a new document, accept it, and correctly ignore content that is new.

Validation logic that can be entirely contained within a generic schema may be executed by services and consumers alike. More complex logic can require a dedicated virtual machine environment to be included, as per the Code-On-Demand [SDP]. Complex validation logic could be processed by the validation logic service itself; however this configuration can result in a performance bottleneck.


Impacts

Strict validation is supported in order to quickly diagnose faults. Changes to the media type are automatically supported by the newly deployed validation logic without changing other aspects of service or consumer processing. This allows new services and consumers to take advantage of the extensions without disrupting old services or consumers.

Media types must be carefully managed to ensure appropriate extension points are present, that new information can be safely ignored by old processors and that old processors relying upon previous, existing information do not have that information suddenly removed. Changes that require must-understand semantics or that break backwards-compatibility in any other way can still require a new media type to be defined.

Principles

Standardized Service Contract, Service Loose Coupling

Architecture

Composition, Service
 
One way to apply this pattern is to create a Validation Logic utility service that provides up-to-date logic for other services. For example, combining Version 2 validation logic with Version 1 data transformation logic validates incoming documents correctly, but extracts only Version 1 information. A special case of the Decoupled Validation Logic pattern is to actually remove all strict validation logic, as per Validation Abstraction. This approach is common on the Web, where acceptance of documents with irregular content is often more important than schema compliance.


Related Patterns in This Catalog

Compatible Change (Orchard, Riley), Concurrent Contracts (Erl), Code-On-Demand (Balasubramanian, Carlyle, Pautasso), Decoupled Contract (Erl), Partial Validation (Orchard, Riley) Schema Centralization (Erl) Validation Abstraction (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.