Implementing Dynamic Dispatch

To implement dynamic dispatch, each class is associated with a virtual function table (vft) that associates the name of a method with its implementation:

A method invocation of the form:

e.calcBonus();

compiles into:

call e.vft.search("calcBonus");

This works because different classes have different virtual function tables.