Friday, January 30, 2009

Idea: Working Diagrams

This is an idea to represent working systems. Working applications are manifested by the files that they are comprised of. So the idea is to rely on expressing the nature of the application using those very files. This is pretty similar to what anybody usually does when whiteboarding out an application - draw boxes representing pertinent pieces of the application. The boxes could be the whole application, or a part of the application or a line in a file of a part of an application. We then draw lines to represent relations that we're interested in. Specs like UML try to formalize this, but for most purposes, we dont need it to be true to the spec - just understandable enough. And there are representations that UML still doesnt (and probably wont) have in it that we'd like to represent - eg the call chain of our build xml's for example, or how two bash scripts relate to each other.

So the idea is to create an app that given the following input, spits out a graphviz (or eclipse emf/visio/jpg/whatever) diagram of the relationships represented by the input.
* one or more dir paths which are considered the nodes of the graph
* each directory and file is a node
* each directory is a hierarchical node and can be folded/unfolded
* a list of plugins that help to identify relationships expressed in each file that can be parsed using, for eg, regexes. The idea of using regex is to to avoid parsing the whole file. Though there's nothing precluding actually parsing the whole file. Eg, a java file plugin would contain regexes to identify method calls and create relations to external classes used as arguments.

Version 2:
Make an interactive version of the output that can be folded/unfolded at will.

Uses:
* Point the tool at your deployed app and get your whole deployment stack displayed as a diagram.

Note: The notion of a file can be generalized to anything whose representation can be queried for interesting relations. Consider, for example a process tree visualization by traversing the /proc directory in unix, and now think of a tool that translates a windows process list into something similar for processing by this tool

I call it Working Diagrams. Its informal and works for purposes of conversation and discussion.

No comments: