System Nesting Map

When navigating through software models, we often need to relate the result to the overall system. To this end, we can benefit from maps.

One common way to see a software system is through its nesting structure: classes are placed in namespaces (or packages), and namespaces are placed in other namespaces (or packages). The most compact way to show a nested structure is via a treemap. I call it the System Nesting Map. It's not a new visualization, similar works having been done before. For example, see Softwarenaut or Quicksilver.

Based on the nice work of Roberto Minelli we can use a treemap builder to create such visualizations in Moose. Here is one example:


Nesting is shown through the gray shades of the border surrounding both classes and namespaces.

So far, there is nothing special. Treemaps are certainly not new. However, the usefulness of a treemap lies in it being a map helping you to locate and relate things. So, what can this map show really?

Take a look at the map below.


This map highlights the client types of a subject class (in our case it is org.tigris.gef.presentation.FigNode from ArgoUML 0.34). We can learn that this class is used in multiple parts of the system. More interesting, but not yet so special.

Now consider having this map as an operator with which you select any group of types in your system and you highlight them on the overall map. Once you have this operator, you can combine it with an interactive query interface, like the finder-like Moose Panel, and you get a quick and flexible way to relate the result of your query to the overall system:


And because it is applicable to any groups of types, you can use it various situations. For example, the screenshot below shows all classes from the system that have at least one annotation:


This is the System Nesting Map. It’s a simple tool that can help you from time to time.

You can find as a separate tab available on any type group in the Moose panel. And if you want to use it programmatically on someClasses from a desired group of namespaces, you can do:

view := ROView new.
FAMIXSystemNestingMap new
          viewNamespaces: namespaces
          highlighting: someClasses
          onRaw: view.
view open

A picture can tell a thousand words, but only when you combine it with interaction do you get a chance of it telling the words you care about.

Posted by Tudor Girba at 27 December 2013, 12:18 am with tags tooling, analysis, moose, pharo link