Exercise 1: Introduction to Architecture Explorer
In this exercise, you will learn how to use the Architecture Explorer tool to navigate project source structure and to generate DGML diagrams that help illuminate subsets of that chosen structure.
- Log in as Abu Obeida Bakhach (Dev) if you have not already done so. The password is P2ssw0rd (capital letter P, the number two, the letter s, the letter s, the letter w, the number zero, the letter r, and the letter d). Please see “Working with the Visual Studio 2010 Virtual Machine” for instructions on how to log into the VM.
- Open Microsoft Visual Studio from Start | All Programs | Microsoft Visual Studio 2010 | Microsoft Visual Studio 2010.
- In Source Control Explorer (View | Other Windows | Source Control Explorer), navigate to Tailspin Toys | Development | Iteration 2 and double-click on the TailspinToys.sln file to open the Tailspin Toys solution.
- Rebuild the solution (Build | Rebuild Solution from the main menu). This step may take a few minutes to complete.
- Close the Output window after the build has successfully completed.
Load Architecture Explorer (View | Architecture Explorer). Architecture Explorer allows you to navigate the types and methods from code starting from either a class view or a solution view.
Figure 1
Initial view of Architecture Explorer
Select the Class View option from Architecture Explorer to view all of the namespaces that are part of the TailspinToys solution. From this point on, clicking on an item from the far right pane will allow you to drill down further into types and members.
Figure 2
Class view showing namespaces from the TailspinToys solution
Scroll down to find the Tailspin.Admin.App namespace and select it to load its types.
Figure 3
Viewing types for Tailspin.Admin.App namespace
Select the ProductRelationship class type to load its members.
Figure 4
Viewing members of the ProductRelationship class
Select the Product property member to see that it contains two methods.
Figure 5
Viewing methods that implement the Product property
This step illustrates that Architecture Explorer is operating on compiled code using reflection. As you will see later on in this lab, you can explore compiled .NET code directly from compiled assemblies.
Select the get_Product method.
Figure 6
Selecting get_Product exposing vertical Calls bar
Each level we drill down into starting with Types has a vertical bar that exposes filtering, grouping, and other commands. Select the vertical Calls bar to expose these options.
Figure 7
Options available when working with type and member nodes
The figure above is not an exact representation of what you will see. You will have to scroll through to see all of these options.
Select the Return Types option found under Outbound Navigation in order to show the return type for get_Product.
Figure 8
Finding return type of get_Product
Select the Product return type to display its members. Note that we are now navigating the Product type, but we still have the historical steps of our navigation to look through also.
Figure 9
Viewing members of the Product type
Select the vertical Members bar immediately to the left of the Product members list and scroll down to the Inbound Navigation section.
Figure 10
Viewing options for Product members
Select the All Inbound navigation option to see all calls that reference the Product type.
Figure 11
Viewing incoming references to the Product type
- Although this may seem redundant from a navigation perspective, select the Product class type from the list of inbound references. Once again, you will see get_Product and set_Product listed.
Select the Create New Graph button from the left side of Architecture Explorer. This will create a new DGML diagram showing the entire navigation path that you manually took up until this point.
Figure 12
Create New Graph button location
Figure 13
DGML representation of manual navigation performed in Architecture Explorer
- Since this is a DGML diagram, we can use all of the standard tools to view it and add or remove nodes. Select the TailspinToys node and press the Delete key to remove it from the diagram.
Return to Architecture Explorer and find the set_Product method that is contained within the Product class. Drag and drop set_Product onto the DGML diagram.
Figure 14
Adding set_Product to the DGML diagram
You can view the source for a type by right clicking on it and selecting View Content.
Clear the selected columns in Architecture Explorer by selecting the Clear Columns button.
Figure 15
Clear Columns button location
Next Step
Exercise 2: Analyzing Project Structure using Architecture Explorer and DGML