9.1. Using Virtual Models for Resolutions

Virtual models in Sonargraph are resolutions containers used to try different solutions for issues in the system without distorting its original status. Sonargraph ships with two virtual models already created: "Parser" and "Modifiable".

  • Parser is the model that is generated by the language specific parsers without structural changes or any resolutions for created issues.

  • Modifiable.vm is the (initially empty) model ready to save any refactorings or created resolutions by the user. It naturally depends on the Parser model.

Virtual models management section is located on the right-hand side of the main toolbar. Using the green plus symbol you can create as many different virtual models as you need to try out different resolutions with your software system and you will always have your original model available in the "Parser" model.

Virtual Models Management
Figure 9.1. Virtual Models

The "Modifiable" model is selected by default so you can start creating resolutions (fixes, ignores or TODO's) right away. On the contrary, the "Parser" model, represents the "facts" model, determined by the parser, which means it can not be modified as it represents the actual state of things on your software system.

NOTE

A virtual model might affect metric values since the structure of the system can be changed with refactorings and issues can be transformed into tasks or ignored. So, depending on what you want you should select the corresponding virtual model. If you want to see the unaltered metrics and structure you should select the 'Parser' virtual model (or an 'empty' virtual model - without any refactorings or resolutions). In the user interface you can either select the virtual model in the right-hand side drop down menu in the upper toolbar or in the Files view on the left hand side underneath the Models folder with the corresponding context menu entry.