Single Dispatch

A kind of Polymorphism where the dispatch mechanism works against a single dynamic type. InternalPolymorphism is almost always SingleDispatch. This is probably because SingleDispatch can be implemented simply and without introducing unwanted coupling with other types.

This is generally done using a virtual function table. Each function is given an index. Each object contains a hidden pointer to some kind of type object that contains a table that has one function pointer for each virtual function that is implemented by the object. The compiler generates code that dereferences the hidden pointer in the object, indexes into the table and calls the function that it finds.

Contrast with MultipleDispatch.


CategoryPolymorphism


EditText of this page (last edited July 15, 2003) or FindPage with title or text search

Meatball