Over a million developers have joined DZone.

Implementing Dynamic Binding in a Different Way

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.

A few weeks back I blogged about "Getting your basics right?" I don't know how many of you agreed with it, however the discussion that took place for filing an RFE, which eventually got filed as Issue #142112, was quite long. If people had understood the issue from the start, it might not have gone on for that long. Anyway, if you would like to comment on it, please read my blog for the details, then go ahead and comment on the issue.

Here's the use case, which was sufficient to justify the filing of the RFE:

 public class UserImpl implements User {

public void callCheck() {
callImpl();
new UserImpl().callImpl();
}

public void callImpl() {
System.out.println("Implementation Invoked...");
}

public static void main(String[] args) {
new UserImpl().callCheck();

// Dynamic Binding...
User anonUser = new UserImpl();
anonUser.callImpl();
}
}

interface User {

public void callImpl();
};

Clicking on callImpl() in line #17 doesn't navigate to the implemented version of callImpl(), i.e. line #08. Instead the user is navigated to line #23. So, this is not how things should be, hence someone filed the RFE. 

What's happening?

Actually, this code was written for the NetBeans IDE Java Editor, and people who were involved in this discussion were taking the IntelliJ IDEA Java Editor as their reference for filing the RFE in NetBeans Issuezilla.

Interesting..

So now one needs dynamic binding while code is being written, which is interesting. As you know, NetBeans IDE provides many features to help the user code. Features such as Mark Occurences, Inline Refactoring, Goto Implementation, and many more...

But do we really need dynamic binding to take place? If somehow implemented, what impact would it have on the performance of NetBeans IDE?

The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}