Implementing Dynamic Binding in a Different Way

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?

Subtitle: 
Getting your basics right?
Article Type: 
Opinion/Editorial
0
Average: 5 (1 vote)

Varun Nischal is an open source enthusiast, an avid blogger of technologies related to, or used with NetBeans IDE. He was also an important member of the NetBeans Community Docs Team and the NetBeans Dream Team. Varun is a DZone MVB and is not an employee of DZone and has posted 10 posts at DZone.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)