
MOOSE FINDER

- Open Moose Finder (there is an instance of MooseFinder already open in order to save time)
- select All model classes
Some are interface classes, so we can use a query to remove these
- query: entity isInterface not
- In the last frame show Complexity
- check for something visually interesting (start to scroll and you should find an enormous black class call CPPParser)
- Select the hugh class
- In the last frame open property

- highlight the number of line of code (because it is black)

- Check if is a "god class" considering the metrics weightedMethodCount (very high), tightClassCohesion (less than one third) and the number of accessesToForeignData (more than few).   
weightedMethodCount is very high
tightClassCohesion is less than one third 
accessesToForeignData is 0

because of the last metrics it is not really a "god class" but anyway, because of its dimension and because the class cohesion is low, it is anyway a class that you want reorganize splitting those clusters of methods and attributes that are tied together.




MONDRIAN EASEL

- in Moose Finder (opened on argo UML) right click on All model classes and open in Mondrian Easel

-Start showing all classes:
view nodes: classGroup.

(The first that you render a big image the scroll bar doesn't appear, so resize the window one time)

- add the structure:
view edgesFrom: #superclass.

- Edges appears but are flat so change layout adding:
view treeLayout.
[because the image is slow I suggest to do those two steps together so when you add the edges add also the new layout ]

Now your script should be like this:
view nodes: classGroup.
view edgesFrom: #superclass.
view treeLayout.

Relate metrics to the shape represents classes adding before the previous script:

view shape rectangle
	height: #numberOfMethods;
	width: #numberOfAttributes;
	linearFillColor: #numberOfLinesOfCode
	within: classGroup.

Now your script should looks like:
view shape rectangle
	height: #numberOfMethods;
	width: #numberOfAttributes;
	linearFillColor: #numberOfLinesOfCode
	within: classGroup.
view nodes: classGroup.
view edgesFrom: #superclass.
view treeLayout.

- Show the monster class that you show before or look for facade classes (tall and generally dark classes -- The typical quality problem is high coupling ) just to show that you can visually detect interesting things. 
(more or less in the middle of the visualization you should find three really tall classes with different colors, all of them are facade)

*OPTIONAL*
- Show other pre-built visualizations (there is an instance of the Transaction Flow visualization in the application bar.)

The Transaction Flow visualization show all methods involved in an application transaction in the Java Enterprise Application load. The classes with colored methods are SessionBeans, the color legend is the following:

1) Blue methods start a transaction (their transaction attribute is ‘Required’ or ‘RequiresNew’).
2) Cyan methods have a transaction attribute equal to ‘Mandatory’, ‘Required’ or ‘Supports’ and are invoked by methods involved in a transaction.
3) Red methods have a transaction attribute equals to ‘RequiresNew’ and are invoked by methods that start a transaction. 
4) Grey methods have no transaction attribute and are invoked by methods already part of a transaction.
5) Orange methods are entry point methods that have a transaction attribute equal to ‘Supports’.

What is interesting:
- Show the red methods because they start a useless transaction. They can simply inherit the transaction scope from the previous methods.
- Identify vertical structure that show represent a functionality accessible from outside. (At the beginning there are two session beans that shared some classes or the fifth session bean from the left is on top a lonely structure)




BROWSERS

[* MISSING A STORY!] STILL TO MODIFY

- You can show the meta model browser executing MooseModel browseMeta (in the Moose Workspace)
* Start to click on elements of the model in the list on the top left to show that those elements are highlighted in image below.
* Then select different relations in panel in the middle showing that they are highlighted in the picture below.
* Select an element in the image and show that it is highlighted in the panel on the top left.
The purpose is to show different instruments that are components of Moose (such as Glamour) that help in the investigation of different aspects of the code in a short time without investing too much effort. 

- You can show the browser for JEA:
* on the Moose Panel right click on the model, select Browse -> Code Browser for JEA

* a browser appears with namespaces, classes and method with an annotation transactionScope on some of them.

* Select an annotated namespace
* Select an annotated class

* Show the blueprint, the transaction flow [*how?] and the source code.

[*What does this tell us?]

- You can show the Dependency browser:
* go on the Moose Panel right click on the model select Browse -> Code Browser with Dependency
(should ask doru how it works, but for sure looks nice for a demo)

Fabrizio Perin
2010-01-16
