Questions tagged [late-binding]

Late binding is a mechanism in which the method being called upon an object is looked up by name at runtime.

Late binding is a mechanism in which the method being called upon an object is looked up by name at runtime.

The specific type of a late bound object is unknown to the compiler at compile time. This is contrasted with early binding, where relationships between objects, methods are properties are established during compile time.

It is expected that questions tagged specifically relate to programming using late bound code. You should also tag your post with the specific programming language being used.

Example (VBA):

' late bound objects are declared As Object
Dim obj As Object
Set obj = CreateObject("Excel.Application")

Related Tags:

353 questions
13
votes
5 answers

Inheritance (Late Binding) via Dependency Injection in Java

I am using Spring DI to wire my components and I came across this issue. I have a BaseService class which has multiple implementations. And the layer above it, has a builder which calls the service to get data to populate POJOs. Service…
13
votes
6 answers

Detect and use optional external C library at runtime in Objective-C

I am building an SDK that iPhone developers can include in their projects. It is delivered as a compiled ".a", without source code. Let's call my SDK "AAA". The customer in his project (let's call it "BBB"), in addition to use AAA, may also use a…
Nathan H
  • 48,033
  • 60
  • 165
  • 247
13
votes
2 answers

Will Function.prototype.bind() always be slow?

I am writing an open source javascript library, and I use .bind() method heavily, because I have an idea that object-oriented code looks more clear then. (debatable, though) Example A1: var that = this; setTimeout(function () { …
Dan
  • 55,715
  • 40
  • 116
  • 154
13
votes
3 answers

knockout.js - deferred databinding for modal?

I am using knockout.js to display a list of employees. I have a single hidden modal markup on the page. When the "details" button for a single employees is clicked, I want to data-bind that employee to the modal popup. I am using the…
Adam Levitt
  • 10,316
  • 26
  • 84
  • 145
12
votes
5 answers

C# - Disable Dynamic Keyword

Is there any way to disable the use of the "dynamic" keyword in .net 4? I thought the Code Analysis feature of VS2010 might have a rule to fail the build if the dynamic keyword is used but I couldn't fine one.
12
votes
3 answers

Why results of map() and list comprehension are different?

The following test fails: #!/usr/bin/env python def f(*args): """ >>> t = 1, -1 >>> f(*map(lambda i: lambda: i, t)) [1, -1] >>> f(*(lambda: i for i in t)) # -> [-1, -1] [1, -1] >>> f(*[lambda: i for i in t]) # -> [-1,…
jfs
  • 399,953
  • 195
  • 994
  • 1,670
11
votes
4 answers

(Automatic) Dependency Injection Binding Mechanisms

The two common mechanisms for creating dependency injection bindings, such as through an IOC container, is from an XML configuration or a block of imperative code. In these cases, the key value pair is explicit (i.e. key = requested type, value =…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
11
votes
1 answer

Tkinter. Create multiple buttons with "different" command function

first of all, sorry for the title, I couldn't find a better one. The following code is a minimalized version of a problem I have in my Python program (I am a newbie btw.). def onClick(i): print "This is Button: " + str(i) return def…
kaan
  • 796
  • 2
  • 6
  • 20
11
votes
5 answers

Late Binding in Java

I have searched through all the similar questions on late binding on stack overflow, and I would severely disagree with anyone who marks this question as a duplicate. First off, i found this example on another question, but I do not understand how I…
user3163829
  • 221
  • 1
  • 2
  • 7
10
votes
4 answers

Double dispatch/multimethods in C++

I have a question on C++ double dispatch. In the code below, I want the results from the second set to match the results from the first set. I don't know the actual type (unless I try dynamic_cast) but I do know that the object inherited from the…
9
votes
3 answers

What is the difference between Binding and Dispatching in Java?

There are too many associated names: Early and Late Binding, Static and Dynamic Dispatch, Runtime vs. Compile-time Polymorphism, etc. that I don't understand the difference. I found a clear explanation, but is it correct? I'll paraphrase…
9
votes
1 answer

Late Binding vs. Polymorphism - what is the difference?

I've seen both used interchangebly but do they really mean the same? From my understanding, Polymorphism stretches the fact that you could exchange an instance of a class by an instance of a subclass, and Late Binding means that when you call a…
helpermethod
  • 59,493
  • 71
  • 188
  • 276
8
votes
2 answers

How do I consume events from a late-bound COM object?

I have a late-bound COM object (My.COMInterface) which raises an event when it has finished processing. How do I consume that event from VB6 code? If I was early-binding, I would declare my COM object as WithEvents, and write a normal…
RB.
  • 36,301
  • 12
  • 91
  • 131
8
votes
6 answers

How can I determine if a compiler uses early or late binding on a virtual function?

I have the following code: class Pet { public: virtual string speak() const { return ""; } }; class Dog : public Pet { public: string speak() const { return "Bark!"; } }; int main() { Dog ralph; Pet* p1 = &ralph; Pet& p2 = ralph; Pet…
8
votes
6 answers

C# DLL's plugin-architecture

I have a program that i developed to use a basic plugin architecture. Effectively, when the program loads it uses reflection to search the directory for dll's that fit a certain interface and then loads them. It now appears that the current list of…
Darren Young
  • 10,972
  • 36
  • 91
  • 150
1
2
3
23 24