G2 handles duplicate attributes that arise from multiple inheritance just as it does those arising from single inheritance: it follows the class inheritance path, uses the first definition it encounters without qualification, and qualifies any others with the relevant class name.
For example, consider again the
PC-NET multiple inheritance structure:
![]() |
Suppose that, as indicated in the figure:
EQUIPMENT defines the attribute Capital-expense
PC defines attributes Use and Location
NETWORK defines attributes Use and Location
PC-NET defines the attribute Use
PC-NET's direct superior classes are PC and NETWORK, in that order
PC-NET's class inheritance path is:
PC-NET,PC,COMPUTER,NETWORK,PERIPHERAL,EQUIPMENT
PC-NET, along with the table of pc-netw-1, an instance of PC-NET.
![]() |
Note that the
Capital-expense attribute appears only once, even though PC-NET inherits it from two different sources: PC and NETWORK. Both of these definitions are really the same definition, inherited from EQUIPMENT, so G2 defines only one Capital-expense attribute in PC-NET. G2 qualifies the other inherited attributes as needed by following the class inheritance path, as described above. PC-NET's direct superior classes were NETWORK and PC, in that order, giving PC-NET the class inheritance path:
PC-NET,NETWORK,PERIPHERAL,PC,COMPUTER,EQUIPMENT
PC-NET would be:
PC::UsePC::LocationNETWORK::Use
Location
Use