Define clear schema creation guidelines
- Versioning, namespaces, and naming
- Use file comments and xsd:documentation
- Define entities shared across schemas in a common schema
- Have a simpleType schema and a commonTypes schemas
Beware of enumerations (make sure it can be strictly defined and will not change). There are actually very few things that can be represented by a truely definitive list. For example, most people think the US states are a good example of an enumeration since there are only 50 of them but what about Guam or the District of Columbia or US Virgin Island.
- Create types in domain schema and create separate message schema that contain messages. The message schemas would leverage the domain schemas. (i.e. Guest.xsd and GuestMessages.xsd)
Schema versioning is one of the greatest concerns when working with a canonical data model. Once developers start using your CDM it becomes harder and harder to make changes without impacting the current services. Determine a standard on how major and minor version numbers will be used to support backward compatibility. We use minor version numbers to represent changes that are fully backward compatibility and major version numbers to represent changes that require users to modify their code to utilize the new schema.
Define magical words that are used consistantly across all schemas.
- If 'Id' is used to identify a single object use it consistantly across all schemas. Don't mix Code and Id (eg. CountryId, CountryCode)
- Use attributes only for metadata and/or optional data