Early Binding

Why Trust Techopedia

What Does Early Binding Mean?

In C#, early binding is a process in which a variable is assigned to a specific type of object during its declaration to create an early-bound object. This contrasts the late-bound object process, where an object type is revealed at the time of instantiation.

Advertisements

Early binding is implemented in a number of C# concepts, such as overloaded methods, overloaded operators and overridden methods, which are directly called via the use of derived objects. Early binding is not flexible and can result in version compatibility issues, due to the high dependency of property and method types and parameters.

Early binding is also known as compile time polymorphism, static binding and static typing.

Techopedia Explains Early Binding

Early binding benefits include:

  • The compiler can perform optimization, which results in more efficient applications
  • Early-bound objects are faster, have better code readability and are easily maintained.
  • Using Visual Studio’s integrated development environment (IDE) as a development tool, early binding aids in rapid application development (RAD) by providing quick access to object properties and methods – reducing typographical errors.
  • Errors are revealed during compilation, which reduces runtime error severity and frequency.

During early binding, the C# compiler performs syntax and type checks to ensure that the correct parameter amount and type are passed to the method or property. Early binding also checks for the return value, which minimizes execution time and runtime errors.

For example, a C# automation client application needs to calculate a value with a defined Microsoft Excel formula. The application may create an object of type Microsoft Excel and call its required method after initializing the object properties. Because Microsoft Excel is a specific type of object, the created and assigned variable is an early-bound object.

While working with early-bound objects, it is necessary to include the type library where the definitions of early-bound object types are defined. Additionally, an early-bound object cannot be used to assign an object of another type after its declaration.

Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…