Tools and

and Set-Up



Overview | Data Storage | Metric Tree | Visualization


MetroViz is a complete system including input, change management, and visualization features. Each of those major clusters of functionality is represented in a separate graphical user interface, tailored to the task being performed. However, all of the interfaces share a common, central data store and basic visual layout. This page gives a high-level summary of the key components of the system architecture, which is elaborated in more detail in the Maintenance Document.

Data Storage

The heart of MetroViz is a single Access database. All information regarding metrics and their associated data values is stored in a few simple tables. The application itself, however, is written in Visual Basic.NET. The most intuitive way to manipulate data in an object-oriented language such as VB.NET is to represent it as discrete data objects, rather than as SQL commands and tabular result sets.

The NHibernate library is designed to bridge this gap between data objects and relational databases through an explicit mapping process. (NHibernate is one of a general class of tools called "Object-Relational Mapping" or ORM toolkits.) Each data object in MetroViz is associated with a particular table in the Access database. Properties of VB objects are represented as data columns in the appropriate table. References between objects are represented as foreign key columns that link to particular rows of other database tables. These mappings from object to relational representation are described to NHibernate in the form of a simple XML document. The figure below shows the architecture of a simple NHibernate application. (The graphic was borrowed from the original Java-based Hibernate documentation, but is equally applicable to the .NET NHibernate port.)

For example, the Metric class in VB is defined in the source file "Metric.vb". Instances of this class are stored as rows in the "Metric" table of the Access database. The mapping that describes to NHibernate how to transform the data from VB to Access and vice versa is stored in the mapping file "Metric.hbm.xml".

In addition to the individual mappings for classes/tables, NHibernate requires some general setup and configuration information. This includes the connection string for communication with the database, configuration of the type of database in use, and other parameters. NHibernate gathers this information from the "App.config" file for the application. The necessary setup can also be performed explicitly in code during initialization. MetroViz currently uses the former method, but as the tool is rolled out to additional departments, the latter method may be preferable.

NHibernate provides a number of sophisticated features to make data persistence a graceful part of an application's codebase. MetroViz takes advantage of these features as appropriate, especially "transitive persistence". This feature allows a developer to persist an entire data structure with a single line of code by automatically following links between objects and detecting changes. We highly recommend that any developer wishing to extend MetroViz read the rich set of Hibernate and NHibernate documentation available online.

Metric Tree

The metric tree (shown at the left) is a common element in all three of the graphical interfaces included in MetroViz. This panel is maintained as a integrated set of controls that work together to provide a strong user experience for MetroViz users. Some of the controls are maintained with complete consistency between the three interfaces. For example, the behavior of the search box is the same in the main visualization interface, the change metrics interface, and the data input interface. Certain features of the metric tree are tailored to each interface, however, and require special care in ongoing maintenance. The code that manages the individual components of the metric tree can be found near the top of the VB code for each of the interfaces.

The tree in the visualization interface has a special set of requirements in order to support the comparison of multiple metrics at the same time. Multiple-selection was implemented as an extension of the standard Microsoft TreeView control. Since this specialized function was developed with the help of sample code available online which was written in C#, it is separated from the rest of the MetroViz codebase. This code can be found in the TreeViewMS project included with the MetroViz source code. Note that since multiple-selection was only required for the visualization interface, the other two interfaces use the standard Microsoft TreeView included with the .NET Framework.

The change metrics interface also has a unique property. It is the only interface which does not include a feature to automatically expand categories that are clicked upon. This difference is necessary to support the drag and drop behavior used to reorder metrics in the tree.


Drawing dynamic graphs is the centerpiece of the MetroViz system. The code which drives the calculation and display of these images is arranged as a multi-stage pipeline. Each step of the pipeline adds richness to the final presentation, checking for errors and compensating for edge cases along the way. At the center of this pipeline is the RecalcGraph() method, which drives the overall flow of the process. The end goal is to properly configure the NPlot library, which handles the actual drawing of graphics to the screen. The best way to understand the details of this process is to step through the code for RecalcGraph() and read the code comments describing each step. More information is also available in the Maintenance Document.

<< Tools and Techniques   Licensing >>

© Carnegie Mellon University, Masters of Human-Computer Interaction, CitiStat project: Peter Centraf, Lisa Edelman, Lorrianne Nault, Matt Sharpe, Adrian Tang