In multiple inheritance, specifying a class as the primary direct superior does not guarantee that the subclass inherits all default values from that class. A subclass inherits the default value of an attribute from the first class in the class inheritance path that explicitly defines one, not from the first class that has one by inheritance.
The examples in this section show how G2 uses the class inheritance path to determine which default values a multiple inheritance class inherits. The examples focus on the system-defined attribute
Icon-description, which defines the icon displayed by an instance. The examples use the PC-NET multiple inheritance structure:
![]() |
PC-NET,PC,COMPUTER,NETWORK,PERIPHERAL,EQUIPMENT
PC and NETWORK classes have their own icon definitions. As in the previous example, the icon by PC is called the workstation icon, and the icon by NETWORK is called the node icon.
![]() |
Since
PC appears before NETWORK on PC-NET's class inheritance path, PC-NET inherits the workstation icon. NETWORK's icon definition has no effect on PC-NET: from PC-NET's perspective, NETWORK's icon definition does not exist: PC's definition has overridden NETWORK's definition. PC's icon definition, and did not define any other icon on the path between PC-NET and NETWORK, NETWORK's icon definition would cease to be overridden, and would be PC-NET's icon definition also. A PC-NET instance would then have a node icon. Overriding the Default Value of a Direct Superior
In the next figure, PC does not define an icon, but COMPUTER and NETWORK do:
![]() |
Since
COMPUTER appears before NETWORK on PC-NET's class inheritance path, PC-NET inherits the workstation icon: the default value given by NETWORK, a direct superior is overridden. The class inheritance path, not the list of direct superiors, determines default value inheritance. Overriding an Inherited Value with an Explicit Value
In the next figure, NETWORK and EQUIPMENT both define icons:
![]() |
Since
NETWORK appears before EQUIPMENT on PC-NET's class inheritance path, PC-NET inherits the node icon: the default value that PC inherits from EQUIPMENT via COMPUTER is overridden. Only explicit specifications, not inherited specifications, can provide default values. Inheriting Default Values for Stubs
Icons and stubs are closely related, but they are specified by two different attributes of a definition. Where multiple inheritance exists, this independence could result in mismatched icons and stubs, so the G2 class inheritance rules contain a special provision that prevents it. none.