8.2.1 Attributes
An attribute is some feature that is associated with an object.
For example, common attributes of a variable include that variable’s name, its memory address, its runtime value, a data type associated with that value, and the size (in bytes) of that variable.
Different objects may have different sets of attributes.
For example, a data type is an object that possesses attributes such as a name and size, but it won’t usually have a value or memory location associated with it.
A constant can have attributes such as a value and a data type, but it does not have a memory location and it might not have a name (for example, if it is a literal constant).
A variable may possess all of these attributes.
Indeed, the attribute list usually determines whether an object is a constant, data type, variable, or something else.
8.2.2 Binding
Binding is the process of associating an attribute with an object.
For example, when a value is assigned to a variable, the value is bound to that variable at the point of the assignment. The value remains bound to the variable until some other value is bound to it (via another assignment operation).
Likewise, if you allocate memory for a variable while the program is running, the variable is bound to the memory address at that point. The variable and address are bound until you associate a different address with the variable. Binding needn’t occur at runtime.
For example, values are bound to constant objects during compilation, and such bindings cannot change while the program is running.
Similarly, some variables can have their address bound to them at compile time, and the memory address cannot change during program execution.
8.2.3 Static Objects
Static objects have an attribute bound to them prior to the execution of the application.
Constants are good examples of static objects; they have the same value bound to them throughout the execution of the application. Global (program-level) variables in programming languages like Pascal, C/ C++, and Ada are also examples of static objects because they have the same memory address bound to them throughout the program’s lifetime. The system binds attributes to a static object before the program begins execution (usually during compilation or during the linking phase, though it is possible to bind values even earlier).
8.2.4 Dynamic Objects
Dynamic objects have some attribute bound to them during program execution. The program may choose to change that attribute (dynamically) while the program is running. Dynamic attributes usually cannot be determined at compile time. Examples of dynamic attributes include values bound to variables at runtime and memory addresses bound to certain variables at runtime (e.g., via a malloc or other memory allocation function call).