Hierarchical Inheritance

Home Overview Four-Level Hierarchy Hierarchical Inheritance

MoStacks' four-level hierarchy works with inheritance for a number of features.

The basic principle: If you take a certain feature, e.g. font, you can specify it on more than one level, in the case of fonts on all four levels of the hierarchy. Lower levels inherit the value of the higher level, unless it is specified on the lower level as well.

Three things are inherited in the way described here: Fonts, colors and scripts.

The mechanism explained in detailed with the example of fonts: If you specify a font at stack level and nowhere else, every field on every card will use that font, because every one will inherit the stack font through the card and the background level. If you now add a font definition for a single card, the whole stack will still use the stack font except everything on that card.

You can look at this the other way round as well: When MoStacks decides which font to use to display a certain field, it starts to look for a font definition on the lowest level, goes up the levels until a font definition is found and stops there i.e. uses that font. (If no font is defined anywhere, MoStacks uses a default font, with MoStacks itself as a sort of a level still above the stack.)

This inheritance mechanism along the four hierarchical levels is very useful and powerful because you can change things quickly and easily. If you want a larger font you don't have to re-define each field of every background, like in some other systems where there is no hierarchy and every element carries its own font definition. In fact, MoStacks has no Zoom function because you can basically zoom by changing the stack font to a larger one!

Of course such wide-ranging changes get more difficult as you add font definitions on lower levels. E.g. if you have a stack with two backgrounds and specify fonts for both of them, the stack font becomes irrelevant: Nothing will carry the stack font anymore, and changing it will change nothing.