I will communicate some experience with database oriented DTDs as they appeared in my work using MSR DTDs as well as Bosch specific ones. These statements don't claim to be generally true in all circumstances.
| | The semantics of the DTD must be defined as strictly as possible. This is the hardest part of the job especially since SGML/XML is pretty weak in terms of data types and formal methods for defining semantics are still missing. Mostly the final semantics is defined during the pilot implementations. It is essential that every definition is documented as exactly as possible.
|
| | As long as instances are authored or viewed using SGML/XML tools it is better to use elements for terminal data rather than attributes. The general handling is more straightforward. The data typing provided by attributes is insufficient anyhow.
|
| | SGML/XML is pretty verbose (terseness is not a design goal for XML ). This causes instances to be very big. For example the data dictionary of an engine management system is about 10 MB where markup is 80% of this. The file size could be reduced substantially by using terse element names (but then the DTD is much harder to understand). Another option is to use empty end tags (which is not allowed in XML but SGML is still there :-). The file size can be a problem especially in pure tree oriented systems.
|
| | If processing is performed using hardwired tools it is often easier to use existing data for linking purposes instaead of introducing artificial access keys (ID/IDREF). In some cases there is no need to really follow the link because the link recreates itself by the synergy of the natural names.
|
| | It is highly recommended to define the data model as completely as possible. Any compromises must be fixed later with much more effort.
|
| | It makes sense to keep the DTD flexible in terms of the possible containers. This makes it much easier for the engineering tools to generate valid instances. The information can very easily be rearranged by SGML/XML tools if one of the readers has different requirements. An example is given above ().
|