Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Late binding
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|When called functions or methods are looked up by name at runtime}} {{About|associating a name with an operation|the selection of an implementation of a polymorphic operation|Dynamic dispatch}} {{More citations needed|date=January 2011}} In [[computing]], '''late binding''' or '''dynamic linkage'''<ref>{{Cite book|url=https://www.cs.rit.edu/~ats/books/ooc.pdf|title=Object-Oriented Programming With ANSI-C|last=Schreiner|first=Axel-Tobias|publisher=Hanser|year=1994|isbn=3-446-17426-5|location=Munich|pages=15}}</ref>—though not an identical process to [[Dynamic linker|dynamically linking]] imported code [[Library (computing)|libraries]]—is a [[computer programming]] mechanism in which the [[Method (computer programming)|method]] being called upon an [[Object (computer science)|object]], or the [[Subroutine|function]] being called with arguments, is looked up by name at [[Run time (program lifecycle phase)|runtime]]. In other words, a name is associated with a particular operation or object at runtime, rather than during [[Compiler|compilation]]. The name '''dynamic binding''' is sometimes used,<ref>Booch, Grady. Object-oriented Analysis and Design. Addison-Wesley, 1994. p71</ref> but is more commonly used to refer to [[dynamic scope]]. With [[early binding]], or [[static binding]], in an [[Object-oriented programming|object-oriented language]], the compilation phase fixes all [[Data type|types]] of [[Variable (computer science)|variables]] and [[Expression (computer science)|expressions]]. This is usually stored in the compiled program as an offset in a [[virtual method table]] ("v-table").<ref>{{cite web|url=http://support.microsoft.com/default.aspx?scid=kb;EN-US;245115|title=Using early binding and late binding in Automation|date= 2003-09-06|accessdate=2014-06-27|publisher=[[Microsoft]]|archive-url=https://web.archive.org/web/20140627041338/http://support.microsoft.com/default.aspx?scid=kb;EN-US;245115|archive-date=2014-06-27}}</ref> In contrast, with late binding, the compiler does not read enough information to verify the method exists or bind its slot on the v-table. Instead, the method is looked up by name at runtime. The primary advantage of using late binding in [[Component Object Model]] (COM) programming is that it does not require the compiler to reference the libraries that contain the object at [[compile time]]. This makes the compilation process more resistant to version conflicts, in which the class's v-table may be accidentally modified. (This is not a concern in [[just-in-time compilation|just-in-time compiled]] platforms such as [[.NET]] or [[Java (programming language)|Java]], because the v-table is created at runtime by the [[virtual machine]] against the libraries as they are being loaded into the running application.<ref>{{cite web| url = http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.6.3| title = The Structure of the Java Virtual Machine: Dynamic Linking| year = 1999 | accessdate = 2013-09-21| at = sec. 3.6.3| publisher = [[Sun Microsystems]]}}</ref>)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)