|
Namespaces, version and prefixThe Meshy Space Interfaces are build on various components, probably written by different people and going through many versions over time. How do we manage these definitions? Especially, how should we use our (XML) tool-set to make this work best. Cooperative Interface Design, OO styleWhen projects are large and many people involved, you really benefit from techniques from Object Orientation (OO). We have chosen to model data in XML Schemas: How does OO design compare with features which XML Schemas offer?
NamespacesOnly serializations which support namespaces are ready for cooperation and long-term maintainability. Lower level specifications may introduce names which are already in use on higher levels. Those accidents may be detected very late and hard to solve. Besides, when elements use definitions which origin from different sources, it can be a pain to find-out which documentation you need. Also for the software. By default XML, does not use namespaces on attributes. Probably because the intention was that elements rarely carry attributes. However, in real schemas, the number of attributes is often not small and from various sources. It is a matter of taste, which rule to take: <shop:product id="123" product-id="342"> <!-- unqualified attributes --> <shop:product db:id="123" shop:id="342"> <!-- qualified attributes --> Meshy Space requires qualified attributes. Versions for SpecificationIn the beginning of XML, the namespace had three roles:
Although the version number is in the path, it is only a numbering
scheme that people can interpret: namespace URL have no required
structure besides being a value URL. When two namespaces differ 1
single letter, they are simply unrelated in the technological sense.
As work-around, people started to use a In Meshy Space, the namespace points to a Meshy Space schemas avoid the requirement to upgrade to the latest version of a schema whenever possible. The consumer of the messages tells the server which version of a schema it understands: the server may adapt its output based on that. Meshy Space Concept "Operations" specify which minimal version of each sub-specification they support. The user always has the newest version of the schemas, however only important is what the software support. No need to upgrade the user's application to understand the newer schema version when the new features are not used and not required by the server. Use of prefixes for namespacesIn a world without prefixes, we would not use long namespaces. In any serialization of messages (also JSON!), namespaces are used on all keys. Of course, the prefixes are not fixed. You may decide to use mark@overmeer.net Web-pages generated on 2023-12-19 |