I was looking at a blob of code that I don’t know where to start to get a handle on what it does. The code also didn’t come with documentation. So, I turned to NetBeans Enterprise Pack 5.5 beta. The feature that I wanted to try was it’s UML reverse engineering features. I downloaded it, installed it on top of NetBeans 5.5 rc1, and started NetBeans. Then I followed this tutorial to generate UML model from source code. The tutorial has some screen-casts that shows you step-by-step on how to use UML modeling features in NetBeans Enterprise Pack 5.5 beta. Finally, I started to generate some class diagrams. The diagrams certainly helped me to better understand which classes are related to which and helped me to conceptualize the blob of java code that I am trying to understand. I was able to export smaller diagrams to image files. Diagrams with larger number of classes didn’t export successfully. I hope it will be fixed by FCS. All in all, it’s a handy feature to keep in your toolbox. Don’t expect to throw away your whiteboard and dry erase markers, you may find them useful too.
At end of the session, I also used Dia to draw a variation of finite state machine to map out the flow of a piece of code.