Making Dependencies Interesting

Abstract: The dependency browser interface has been updated again. See how this window has changed over time and the new options available.

Everyone knows that eating vegetables is healthy, but actually eating them is a different story. It’s why we need chefs to disguise them. Dependencies are the same way. They’re important, but using the dependency tools in Understand isn’t always appealing. So, how can they be made more useful? Here’s a brief history of the dependency browser.

Remember Understand 5.1? It feels like a long time ago. The dependency browser looked like this:

The Dependency browser in Understand 5.1

To be honest, none of the Understand engineers love the dependency browser, even now. But, there were two primary complaints motivating an update. First, the dependency browser couldn’t be resized easily because of the combination boxes in the toolbar. So, opening it could force the whole user interface to resize. The second complaint may have been unique to me, but since I usually end up with dependency fixes, it qualifies as major. I dislike expanding trees. There are only 4 references and yet the tree has 12 nodes. That’s three times more than I need to see.

So, the 6.0 dependency browser changes:

  1. Move most of the options out of the toolbar and into a configuration panel. This makes the dependency browser much more resizable and also hides some of the complexity. 
  2. Auto-pick the grouping to show better default views. This flattens the architecture tree whenever possible, picks the groups based on the scope, and choses nested groups based on thresholding. So, in the next picture, the grouping is by file because egrep.c is a file, and there are no entity groups because there are fewer than 20 references to display. To support old users, “custom mode” retained the old behavior.
  3. Get rid of the icons because they’re redundant and add clutter.
  4. Show references in the left tree. It simplified the code, and having egrep.c have a child egrep.c felt weird to me. What kind of “Back to the Future” view was that implying?
Changes in the dependency browser from 5.1 to 6.0

The 6.0 dependency browser looked like this:

The dependency browser in Understand 6.0 for the same file (after the internal dependency updates allowing dependencies to unresolved entities and declaration files)

With the most recent build (1086) the dependency browser has once again been updated. Disguising vegetables is a lot of work. I feel bad for chefs. 

  1. One of the major complaints was the references in the left tree. People wanted them gone, with a view similar to 5.1. At least we named them “Direct” instead of duplicating the parent’s name. 
  2. Another problem was the common task of switching between “Depends On” and “Depended On By” involved opening up the config dialog. This was made shorter by having a drop-down similar to the scopes list drop down in the editor for picking dependency direction.
  3. A final problem, related to point 1, was the grouping. Forcing the grouping into File, Class, and Entity levels made it hard to group things naturally, like having enumerators appear grouped under their Enum. Custom grouping also obscures the true dependencies because it relies on the definition file instead of the file determined by the calculation. So, the grouping options have been changed in the most recent version and are accessible in the hamburger menu, removing the config dialog entirely.

So, the latest dependency browser looks like this:

The dependency browser in Build 1086

One final change. Have you ever been frustrated or confused by the fact that class dependencies only show references between classes? Sometimes you just want to take a class, or an Enum, and see all the references to it and any descendants. The dependency browser now supports that, similar to how it supports showing references from clicking on edges in most graphs. Check out the drop-down for a class/struct/union:

New “References From” and “References To” views

The references to/from options are available for all non-file entities (for file entities, the options are equivalent to Depends On / Depended On By). So, next time you want to refactor an Enum and need to see everywhere any of the enumerated values are used, try the dependency browser. And, if it’s falling short, recommendations for this novice chef are appreciated. We’d love to hear how you use the dependency browser or want to use the dependency browser for the next iteration.