Monday, December 03, 2007

Jung Juggles Data Jungles

I am convinced that one of the tasks of a software architect consists in improving or building tools for software developers, so they can be more efficient in their daily dose of fun called "work". This of course includes visualization tools, a subject dear to Gregor Hohpe, who gives great insights on how and why visualization can help make sense of data whose amount or lack of order make hard to grasp.

Beginning of this year, I started to experiment with a very good library named JUNG, an acronym that means "Java Universal Network/Graph framework" and explains exactly what it is. So far I have built a pair of tools:
  • A grapher that analyzes the JCR repository of a web CMS and represents the component and templates as graphs, by following the hierarchy of inheritance they engage into.
  • A analyzer that parses a lenghty JavaEE web application deployment descriptor and represents as a tree the filters involved into processing HTTP requests.
Very easy and fast to develop, thanks to JUNG's clear API, these visualizers have been useful to find out discrepancies: for example graph disconnections or node duplications were nice visual clues that helped locating problems.

I invite you to explore the power of visualization on your own, with your own data and challenges.

2 comments:

Michael Marth said...

David, the JCR visualization sounds interesting. Would you like to show us some examples?
Cheers
Michael

--
http://dev.day.com

David Dossot said...

Here is a screen shot of the components and templates graph for a particular Day CQ application. It is voluntarily zoomed far back to show the big picture.

On this graph:
- components are shown as round corner rectangles, templates are regular rectangles,
- they have a red border if they do not belong to the application that is currently explored, else it is green.
- disconnected elements can reveal bad inheritance (for example a disconnected template when all templates should extend a base one).

Note that Jung natively offers zooming and node moving.