Geertjan's Blog

  • March 6, 2011

How to Analyze Java Desktop App Features Prior to Porting to the NetBeans Platform

Geertjan Wielenga
Product Manager
Porting an application to the NetBeans Platform is an intricate process precisely because an application's features tend to be tangled throughout the application. It would be pretty handy if you could somehow analyze your application to determine where all the code related to a particular self-identified feature is found. For example, imagine if we'd be able to annotate entry points into features (however you define those entry points is up to you) as follows:
@FeatureEntryPoint( "program startup" )
public static void main(String[] args) {
UIManager.put("Button.defaultButtonFollowsFocus", Boolean.TRUE);
DataInfo di = new DataInfo();
NDVis nv = new NDVis(di);

Next, we would run an analyzer on our application. Many details about the tangledness of our features would then be determined, i.e., every piece of our code that is called by the entry point above would be marked in the IDE, as follows:

Take note of the vertical bar on the left of the screenshot above. That shows that the current piece of code is part of a self-identified feature (i.e., it is called during the execution of that feature). And when I hover on that vertical bar I can see, as can be seen above, the name of the feature to which it belongs.

But that's kind of only the tip of the iceberg. The movie of how this analyzer works is worth watching. I made that movie while I was in Denmark recently, where Andrzej Olszak, the analyzer's lead developer, demonstrated it during a course.

The point is that now it is available here from the Plugin Portal and here is the related website with all details, including a tutorial that uses the Anagram Game.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.