Inheritance
The convention of "inheritance" within MDDL is similar to inheritance in programming languages or object-oriented design.
Applied to the MDDL XML-based schema: if a child-node needs a certain qualifying property (for example, if a last price needs a currency) and the qualifier isn't at the same level in the document hierarchy then the currency may be found upwards through the hierarchy.
Inheritance is often used in conjunction with shorthand. Note that a property at a higher level may still be overwritten by a qualifier within a child.
Example WITHOUT inheritance:
<ask>
<last>
<mdDecimal>102.34</mdDecimal>
<currency>JPY</currency>
</last>
<open>
<mdDecimal>102.21</mdDecimal>
<currency>JPY</currency>
</open>
</ask>
Example WITH inheritance:
<ask>
<currency>JPY</currency>
<last>
<mdDecimal>102.34</mdDecimal>
</last>
<open>
<mdDecimal>102.21</mdDecimal>
</open>
</ask>
Example WITH inheritance AND shorthand:
<ask>
<currency>JPY</currency>
<last>102.34</last>
<open>102.21</open>
</ask>
Example WITH inheritance AND shorthand, but with override:
<ask>
<currency>JPY</currency>
<last>102.34</last>
<open>
<mdDecimal>102.21</mdDecimal>
<currency>EUR</currency>
</open>
</ask>
In this example, the 'last' and 'open' properties (which are defined with a classification of 'price') require a 'currency' as a qualifier. Because the 'currency' is not found at the same level, it is inherited from the upper level (in this case, it is a child of 'ask' but it could be higher in the hierarchy).









