Name binding

In programming languages, name binding refers to the association of identifiers with runtime entities such as objects and functions. An identifier is bound when it is associated with an actual object. Because of this, name binding is closely related to object lifetime. Name binding bridges the conceptual gap between the program as described by its source code, and the program as it actually executes at runtime.

When discussing binding for compiled languages we often pretend that the program is executed in its source code form, because the actual identifiers do not actually exist anymore at runtime. In these cases, the binding process is merely an imaginary conceptual process.

Binding at multiple levels

Consider the following Java code:

String s;
// ...
s = "bar";
// ...
s = null;

While s is not bound to an actual Java object when it is introduced, it is bound to an implicit reference object that is capable of referring (binding) to an actual Java object. One could say that s is bound the moment it is assigned an object to refer to, but clearly this is a different level of binding. Similarly, the last line unbounds s in that it is no longer associated with an actual Java object, but it is still associated with an implicit reference object. Thus, binding can occur at multiple levels.

Binding time and scoping types

In interpreted languages, all binding takes place at runtime.

Due to the multi-level and conceptual nature of binding in compiled languages, it is often hard to say if and when binding takes place. For example, while the identifier-to-memory-offset translation of C local variables is performed at compile time, the absolute address of the variable is not known until the function is actually executed at runtime (not taking optimization into account).

Binding time and type of variables (in particular local variables) is heavily influenced by scoping. In particular, lexical or static scoping is also known as deep binding, while dynamic scoping (which more or less takes place at runtime) is also known as shallow binding. See static versus dynamic scoping. Dynamic scoping requires the binding process to have a runtime aspect, since it depends on the program state.

One example of a type of binding that clearly has a very significant runtime aspect is dynamic dispatch (also called dynamic binding), where the entity that an identifier is bound to is determined based on information that is only available at runtime (such as the runtime type of the object that a virtual method is being called on).

For named objects with static duration such as simple functions and global variables, binding takes place at compile or link time: the binding is fixed during the execution of the program, and is as such static.

See also


  • Art and Cultures
    • Art (
    • Architecture (
    • Cultures (
    • Music (
    • Musical Instruments (
  • Biographies (
  • Clipart (
  • Geography (
    • Countries of the World (
    • Maps (
    • Flags (
    • Continents (
  • History (
    • Ancient Civilizations (
    • Industrial Revolution (
    • Middle Ages (
    • Prehistory (
    • Renaissance (
    • Timelines (
    • United States (
    • Wars (
    • World History (
  • Human Body (
  • Mathematics (
  • Reference (
  • Science (
    • Animals (
    • Aviation (
    • Dinosaurs (
    • Earth (
    • Inventions (
    • Physical Science (
    • Plants (
    • Scientists (
  • Social Studies (
    • Anthropology (
    • Economics (
    • Government (
    • Religion (
    • Holidays (
  • Space and Astronomy
    • Solar System (
    • Planets (
  • Sports (
  • Timelines (
  • Weather (
  • US States (


  • Home Page (
  • Contact Us (

  • Clip Art (
Personal tools