XMLPatterns.com

Reuse Document Types

Abstract

If document types already exist for the job at hand, they can be reused completely or parts of them can be reused.

Problem

A new set of data needs to be marked up with XML and a document type is needed.

Context

This applies to almost every project. Before starting to create a new document type, existing ones that can be used should be looked for.

Forces

Reusing existing data cuts down on development costs and times.
Using industry standard document types increases chances that existing tools can be used out of the box, and allows for future interoperability.

Solution

Reuse an existing document type. If an industry standard document type already exists, it should be reused.

Examples

Discussion

Before anybody creates a new document type, existing document types should be investigated.

Complete Reuse

Ideally a document type will exist that precisely matches the needs of the project. This can be beneficial in many areas:

Partial Reuse

If existing document types do not exactly match the needs of the project, they can be partially reused. Modification can be made to document types to allow this partial reuse. The easiest way to do this is simply to edit the existing document type. Some document types may allow for customization through techniques such as Extensible Content Model . Partially reusing document types still has the benefits of decreasing development time and cost, and reusing experience, but will not allow for interoperabilty. If interoperabilty is a desired goal of the system, modification of existing document types must be looked at very carefully.

Related Patterns

Known Uses

Many of the document types found in the references section are being reused in multiple projects.

References

There are several sources of existing schemas on the web: XML.org's Catalog (http://www.xml.org/xml/registry.jsp) Schema.net (http://www.schema.net/)