While XML Authority can be used to create XML schemas of all shapes and sizes, developers planning to build large or complex schemas should plan the overall architecture they want to use for their schema. Schema development typically consists of two large tasks: deciding which information will be included in your schema, and then deciding how to represent it. Also critically important to the long-term maintenance and use of your schema are the issues of schema architecture. The tools that define schemas allow you to put declarations and parts of declarations into convenient packages for easy reuse and management.
On the large scale, you can build schemas out of smaller schemas. By combining smaller
units, you can create modular schemas and reuse the modules in other projects. Even if you
don't plan to reuse parts of your schema, modular schemas are often easier to manage, as
each piece contains fewer declarations than the combined version. XML Authority provides
tools for creating and managing modular schemas in the Overview
Pane. XML Authority also highlights declarations which are imported from modules and
aren't actually part of the current schema with a small slashed document icon ( - as used in Figure A).
Figure A - Declarations imported from a module.
Modules are generally appropriate in situations where the parts of a schema are distinct - typically where the parts of the final document don't have too much shared information. While the parts should be distinct within the document type, they may then be shared across document types in other schemas. If a schema contains declarations that could conceivably be used in another schema (even a schema with a completely different purpose), separating those declarations out into their own module for future reuse makes sense.
In many cases, schemas contain multiple declarations with similar content. XML Authority's reusables make it easy to create small modules within schemas, centralizing information that is used repeatedly. Reusables allow you to describe something (like an element content model, a set of attribute declarations, or a set of constraints) in a single declaration and then reference the declaration rather than rewriting all of its contents. In addition, this simplifies the task of managing information like data typing, as XML Authority will keep track of features like data types within reusables.
Reusables may seem less 'architectural' than module inclusion, but both techniques rely on the same set of declarations (parameter entities), and both can be used to create complex schemas with a relatively small number of declarations. Reusables referenced in a module can be used in the parent schema including that module, making their relationship even stronger. Typically, deciding which declarations go in separate modules is a high-level task that should be performed early in the schema development process, while the creation of reusables is a more tactical decision that can be done at any point in schema creation. (If you plan to use reusables across multiple modules, however, it's best to focus on them early.)
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516