Skip to main content

Dynamic binding == late binding in Java or not?



In different sources i've read different things on the topic. For example Wikipedia says:







Late binding is often confused with dynamic dispatch, but there are significant differences.







But a couple lines later







it is popular to use the term late binding in Java programming as a synonym for dynamic dispatch. Specifically, this refers to Java's single dispatch mechanism used with virtual methods.







So where's the truth and what are this "significant differences"?


Comments

  1. Late binding and dynamic single dispatch are, for all intents and purposes, the same. In dynamic single dispatch, the value or identity of a single object determines which code is invoked at runtime, and that's what happens in Java.

    The term dynamic dispatch in general is most often used to imply dynamic multiple dispatch, which is where the runtime method is chosen at runtime based on the identities or values of more than one object, which is a language feature in CLOS and Smalltalk, but not in Java or C++.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...