DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

MindHacks > MixIns > MixIn > MockObjects > ModPythonHosts > ModPythonOnHrConcepts > ModWSGI > ModelDrivenArchitecture > ModelDrivenProgramming > ModelDrivenArchitecture > Monads > MonkeyTyping > Mono > Monotone > MouseGestures > MultiMethods > DynamicDispatchClear Trail
Main /

Dynamic Dispatch

(weitergeleitet von Main.MultiMethods)

Polymorphism
AbstractDataType

the process of mapping a message to a specific sequence of code (method) at runtime


Single Dispatch

The code to be invoked is determined by the type of the receiver of a message alone.
Common OOP is based upon single dispatch (see Polymorphism).

Double Dispatch

VisitorPattern In languages that do not support multiple dispatch one can achieve surrogate behavior by something called double dispatch:
  1. dispatch to a method according to the runtime type of the object that recieves the message
  2. that method dispatches according to the types of its arguments (rather explicitly)

the visitor pattern simulates double dispatch in a conventional single-dispatch object-oriented language such as Java , Smalltalk, and C++.[1]


Multiple Dispatch

The code to be called is determined by the (runtime type of the) arguments of the method.
Such a method is called multimethod.

Making functions virtual with respect to more than one object[2]

Overriding on all arguments. -> Overloading not needed. [3]

Multiple dispatch or multimethods is the feature of some object-oriented programming languages in which a function or method can be specialized on the type of more than one of its arguments.


Multimethods


Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 11.01.2010 21:05 Uhr und seit 7. April 2005 2404 aufgerufen.