ITWissen.info - Tech know how online

Dynamic binding

In statically typed languages a variable is bound to a type and thus the type of the assigned object and the memory area are fixed.

To realize polymorphic variables, the memory area must be separated from the variable in any case. For this programming languages offer pointer types: a variable takes now only a reference to an object - thus to its memory area. If a message is sent to the object thus referenced by the variable, type information is obtained from the value of the variable at runtime - as in dynamically typed languages - and the appropriate method is called. Therefore one calls this methodology also dynamic binding of a method to a message. With their application the aspect of the efficiency is to be considered.

In contrast to the dynamic binding is the static binding. By static binding one understands the linkage of a message with the method to be executed at translation time. When a method is called via an object reference, the referenced class and thus the method to be executed is determined at translation time.

Informations:
Englisch: Dynamic binding
Updated at: 07.12.2009
#Words: 180
Links: indium (In), object (O), memory, area, message (MSG)
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024