What is 'Binding time' in the context of development?

Asked

Viewed 192 times

2

In the software quality study I came across this term 'Binding time' (connection time) and I was somewhat lost in the concept. So what exactly is?

  • https://en.m.Wikibooks.org/wiki/Introduction_to_programming_languages/Binding can be a good read

1 answer

1

To understand what it is Binding time, we can start with what it means Binding.

The term Binding in this context is the act of making a association, is an attribute, symbol, entity or transaction.

The term Binding Time is when this will occur. The moments that exist for this are several:

  • in programming time: when the programmer writes the code
  • in compilation time: when the compiler creates the runtime file (.class in Java, .dll in C#, etc).
  • in charging time: when the operating system starts the program. A static variable may be limited to a space in memory.
  • in running time: when the program is running. The bind occurs with a non-static local variable in a memory space.

Some of the above explanations may be valid only for some languages. Other authors prefer to disregard some of them or add others. But the goal here is to pass the concept.

The majority of decisions Binding time are related to variables, which have several properties: name, scope, type, location in memory and value. All of them can be determined at compile or run time.

Below I will present a example very simple showing the difference of Binding time in programming time and running time.

Consider that you want to print a value on the screen. In Java, we can do:

String valor = "Alô Mundo";
System.out.println(valor);

In the example above, the value is always Alô Mundo and was decided by the programmer. That is, it is a Binding time in programming time.

However, if the code is changed to receive this value from the user:

Scanner scanner = new Scanner(System.in);
String valor = scanner.nextLine();
System.out.println(valor);

The Binding time becomes by running time, because it will only be possible to know the value of the variable during the execution of the program.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.