International Developer Logo Last Updated 19.11.08 at 11.48
 
TUTORIALS

Consumer-driven contracts: a service evolution pattern


Ian Robinson   11.09.06

Extension points

Making schemas both backwards and forwards compatible is a well-understood design task, best expressed by the Must Ignore pattern of extensibility. The Must Ignore pattern recommends that schemas incorporate extensibility points, which allow extension elements to be added to types and additional attributes to each element. The pattern also recommends that XML languages define a processing model that specifies how consumers process extensions. The simplest model requires consumers to ignore elements that they do not recognise – hence the name of the pattern. The model may also require consumers to process elements that have a “Must Understand” flag, or abort if they cannot understand them.

This is the schema on which we originally based our search results documents:

 

<?xml version=”1.0” encoding=”utf-8”?>

<xs:schema xmlns=”urn:example.com:productsearch:products”

                xmlns:xs=”http://www.w3.org/2001/XMLSchema”

                elementFormDefault=”qualified”

                targetNamespace=”urn:example.com:productsearch:products”

                id=”Products”>

  <xs:element name=”Products” type=”Products” />

  <xs:complexType name=”Products”>

    <xs:sequence>

      <xs:element minOccurs=”0” maxOccurs=”unbounded” name=”Product” type=”Product” />

    </xs:sequence>

  </xs:complexType>

  <xs:complexType name=”Product”>

    <xs:sequence>

      <xs:element name=”CatalogueID” type=”xs:int” />

      <xs:element name=”Name” type=”xs:string” />

      <xs:element name=”Price” type=”xs:double” />

      <xs:element name=”Manufacturer” type=”xs:string” />

      <xs:element name=”InStock” type=”xs:string” />

    </xs:sequence>

  </xs:complexType>

</xs:schema>




   Previous Page  1 2 3 4 5 6 7 8 9 10 ... Next Page   

HAVE YOUR SAY
This article is rated  Rate this article