5.2 Finding your way through models
The basic user interface of Moose is the Moose Finder, and its goal is to offer a generic user interface for navigating large models. The Moose Finder is embedded in the Moose Panel and can be obtained by clicking on a model from the left pane.
The Moose Finder was designed to support four basic analysis actions:
- introspection: given an entity, retrieve its properties;
- selection: given a group of entities, retrieve those that match a set of criteria;
- navigation: given an entity, retrieve other entities that are related;
- presentation: given a group of entities, arrange them according to a set of criteria.
Let us take these each at a time and see how they are mapped on the interface of the Moose Finder.
Introspection is obtained by spawning another pane with the details of the currently selected entity. In the picture above we are introspecting the model itself. In the picture below we are introspecting a group of classes.
Similarly, the picture below shows the detailed properties of one class.
Selection is supported through the interface dedicated to a group. By entering a query in the bottom text box, the corresponding entities are selected in the group and this selection can consequently be seen on the next pane. The query language is plain Smalltalk. For example, in the figure below we see a Finder opened on a group of all classes from the model and with the classes that have more than 10 methods selected.
The query above is transformed behind the scene to:
group select: [ :each | each numberOfMethods > 10 ]
Thus, the actual query interface is provided by the API of the entities that we are browsing.
Navigation can be achieved in two ways. First, when focused on a single entity, the Finder offers a Navigation pane with a list of possible entities that can be spawned from the current entity. For example, in the picture below given a class, we can navigate to its methods, to its superclasses or to the parent namespace.
Sometimes, the default navigation paths are not enough. For example, given a class we might want to get to all methods from the system that reference this class. Yet another case is when we want to obtain information from a group. For example, from a group of classes we might want to obtain all methods. To accommodate these cases the Finder offers a workspace in the Evaluator tab. In this workspace we have access to the current entity via self
and we can evaluate any Smalltalk code. In the picture below we see the result of obtaining all methods from a group of classes.
Presentation is supported in multiple ways. First, for each entity, there are several tabs available. For example, given a class group, we can select the Complexity tab showing the System Complexity visualization for the group (see Section 6.1). As this visualization displays classes, selecting one of them spawns the class to the next pane where for example we can select to see the Blueprint tab (see Section 6.2). Selecting a method in the Blueprint leads to opening it in the next pane and so on (as can be seen below).
Second, for each entity, Moose offers a menu through which further visualizations and tools can be spawned.
In summary, the Moose Finder is a generic browser supporting the philosophy of keeping data at the center and enabling the analyst to choose the path of analysis at each step. While Moose does provide other graphical tools that are dedicated to certain analyses, the goal of the Moose Finder is to offer basic services that can be used regardless of the analysis goal.