Object-oriented programming: Difference between revisions

Content deleted Content added
m Fixed typo
m The first portion that I deleted was plain wrong: abstract data type is about the behavior of a computational structure (call it an object), such as dynamic dispatch, but not about its implementation. There is no restriction on the type of behavior that an ADT can define.
Line 189:
 
===Dynamic dispatch/message passing===
It is the responsibility of the object, not any external code, to select the procedural code to execute in response to a method call, typically by looking up the method at run time in a table associated with the object. This feature is known as [[dynamic dispatch]], and distinguishes an object from an [[abstract data type]] (or module), which has a fixed (static) implementation of the operations for all instances. If the call variability relies on more than the single type of the object on which it is called (i.e. at least one other parameter object is involved in the method choice), one speaks of [[multiple dispatch]].
 
A method call is also known as ''[[message passing]]''. It is conceptualized as a message (the name of the method and its input parameters) being passed to the object for dispatch.