Welcome to MSDN Blogs Sign in | Join | Help

Schema Design Patterns: Salami Slice

This is the second of five entries talking about schema design patters.  The previous entry discussed the Russian Doll approach.

In the Salami Slice approach all elements are defined globally but the type definitions are defined locally.  This way other schemas may reuse the elements.  With this approach, a global element with its locally defined type provide a complete description of the elements content.  This information 'slice' is declared individually and then aggregated back together and may also be pieced together to construct other schemas.

 

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:element name="BookInformation">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Title"/>
                <xs:element ref="ISBN"/>
                <xs:element ref="PeopleInvolved">
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Title"/>
    <xs:element name="ISBN"/>
    <xs:element name="PeopleInvolved">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="Author"/>
                <xs:element ref="Publisher"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="Author"/>
    <xs:element name="Publisher">
</xs:schema>

 

The advantage is that the schema is reusable since the elements are declared globally.

The disadvantages are: the schema is verbose since each element is declared globally and then referenced to describe the data which leads to larger schema size.  This approach also is not self contained and is coupled.  The elements defined may be contained in other schemas and because of this the schema is coupled to other schema and thus changes to one schema will impact other schemas.

This type of approach is commonly used since it is easy to understand and create reusable components.  It would be an appropriate design to promote reusability and data standardization across differing applications.  This approach is not, however, recommended when modifications to the standard elements will be necessary.  If the length, data types, restrictions or other modifications of the elements need to be changed then this will cause added work as well as a larger impact to other systems.

Published Monday, April 25, 2005 12:00 PM by skaufman
Filed under:

Comments

# Schema Design Patterns: Venetian Blind

Friday, April 29, 2005 12:29 PM by Stephen Kaufman's WebLog
This is the third of five entries talking about schema design patterns.&amp;nbsp; In previous entries the...

# Schema Design Patterns: Garden of Eden

Tuesday, May 10, 2005 10:54 PM by Stephen Kaufman's WebLog
This is the fourth of five entries talking about schema design patterns.&amp;nbsp; In previous entries the...

# DataSets and Web Services

Wednesday, May 11, 2005 1:55 AM by Erno de Weerd

# DataSets and Web Services

Wednesday, May 11, 2005 2:15 AM by Erno de Weerd

# DataSets and Web Services

Wednesday, June 08, 2005 2:20 AM by Erno de Weerd

# DataSets and Web Services

Tuesday, July 19, 2005 8:09 AM by Erno de Weerd

# DataSets and Web Services

Tuesday, August 02, 2005 2:21 AM by Erno de Weerd

# Stephen Kaufman s WebLog Schema Design Patterns Salami Slice | Portable Greenhouse

# Stephen Kaufman s WebLog Schema Design Patterns Salami Slice | Portable Greenhouse

# Stephen Kaufman s WebLog Schema Design Patterns Salami Slice | Portable Greenhouse

# Stephen Kaufman s WebLog Schema Design Patterns Salami Slice | garden decor

Anonymous comments are disabled
 
Page view tracker