call next method. Under all other circumstances, G2's use of class inheritance paths filters out any direct effect of multiple inheritance on methods.G2 uses class inheritance paths to support methods in two different ways:
call next method, G2 scans the inheritance path of the class to which the calling method applies.
call next method in a sequence of increasingly general methods can be predicted from the inheritance path of the first method invoked: G2 will simply follow that class's inheritance path to the root class.
call next method, G2 scans the inheritance path of the class to which the calling method applies. This path may differ radically from the path that G2 previously followed to get to the calling method!
all next method invocations in multiple inheritance can be very complex. This complexity does not result from any special action of G2, which invokes methods in exactly the same way irrespective of the particular class hierarchy. It results from the fact that in multiple inheritance, a class's hierarchy path is not a simple extension of a unique superior class's path, but a linearization of two or more different inheritance paths.For example, assume that, as shown in the next two figures:
CAR-BOAT and BOAT-CAR, are defined with multiple inheritance.
vehicle::invoked, car::invoked, and boat::invoked, each of which places a message on the Operator Logbook workspace when invoked.
start action to invoke one of the methods by means of a method declaration named invoked.
![]() |
![]() |
call next method statement caused the method of the next superior class in the class inheritance path to be invoked. The next figure shows the MESSAGE-BOARD workspace after pressing action-buttons 1 and 2, and after pressing buttons 3 and 4.
![]() |