Differences between Dynamic Dispatch and Dynamic Binding

Posted by Prog on Programmers See other posts from Programmers or by Prog
Published on 2014-04-12T13:12:59Z Indexed on 2014/06/11 21:39 UTC
Read the original article Hit count: 438

I've been looking on Google for a clear diffrentiation with examples but couldn't find any.

I'm trying to understand the differences between Dynamic Dispatch and Dynamic Binding in Object Oriented languages.

As far as I understand, Dynamic Dispatch is what happens when the concrete method invoked is decided at runtime, based on the concrete type.

For example:

public void doStuff(SuperType object){
    object.act();
}

SuperType has several subclasses. The concrete class of the object will only be known at runtime, and so the concrete act() implementation invoked will be decided at runtime.

However, I'm not sure what Dynamic Binding means, and how it differs from Dynamic Dispatch.

Please explain Dynamic Binding and how it's different from Dynamic Dispatch. Java examples would be welcome.

© Programmers or respective owner

Related posts about object-oriented

Related posts about languages