PDC09 – Day One – Code Visualization, UML and DSLs

Cameron Skinner – Product Manager in Visual Studio, responsible for the Architecture Tools in VS2010


  • Complexity remains a serious problem
    • Found everywhere
      • Code
      • Requirements
      • Organizational Politics
      • and so on…
  • VS2010 attacks these problems by increasing
    • Shared understanding between team members
    • the understanding of existing systems
    • the ability to gain and maintaining the control over it


  • Developers are trying
    • to understand existing code
    • focused on the “right fix”
  • Architects are trying
    • to understand the Domain and how it relates to implementation
    • get the solution for the existing projects

Product Capabilities

  • “Understand the Code”
    • Architecture Explorer
    • Sequence Diagram Generation
    • DGML Graphs and “Standard” Graphs
  • “Maintain Control”
    • Layer & Diagram & Custom MSBuild Tasks
    • Work Item Integration
  • “Understand the Domain”
    • UML 2.x Designers
  • All this capabilities are only in the Ultimate version of VS2010

“Understanding the Code”

In Visual Studio Options, “Mark the Show Misc Documents in Architecture Explorer”

Dependency Diagram

  • Very interesting Dependency Diagram that represent you application and all the interaction of the solution and you even can search who in your solution is using a specific assembly and what is being made with it.
  • If we use MEF, Unity or any other Dynamic connection this won’t be possible to see in the Dependency Diagram, since it currently represents only the static dependencies.
  • Think of Dependency Diagram as read-only, since if you make any change on it he won’t change any of the code of the solution associated.
  • The Dependency is a DSL that was generated for this version of VS2010.
  • We can select just the elements that we want to view in the Dependency Diagram and define which level of information we want to have, like:
    • Assemblies
    • Namespaces
    • Types
    • Methods
    • We can even filter by access modifiers:
      • public
      • private
      • protected
      • internal
      • protected internal
  • We can navigate to the code from the Dependency Diagram.
  • Doesn’t work on unmanaged C++, but is currently being done but no date for the release now.
  • We can interact with the Diagram and extend the DGML model but in a simple model
  • Possibility to define the level and the center of the dependency that you want to see
  • Butterfly mode enables the viewing of only the types that are just linking to your central defined element
  • We can generate the Dependency Diagram based on a Custom selected elements

Note: We can Calculate the Complexity by right-clicking on the Project and selecting the “Calculate Complexity” option of the Context Menu, but this isn’t currently available inside the Dependency Diagram.

Architecture Explorer

  • Capabilities to filter information about your solution
  • Ability to look at the Logical and Physical View of the Solution Projects and filtering what you want to filter in terms of inbound or outbound navigation, and this way we’ll have more information’s about how our solution is working and how we can maintain it.

Sequence Diagram

  • Now you have the ability to define the depth of the diagram in terms of levels and them expand if you want more directly on the diagram
  • Designed to be collaborative and to persist the changes made on the Model, and it will identify the changes that were made on the diagram and associate that change to a new Work Item.
  • Works on all versions of .NET Framework
  • Doesn’t generate the code on by changing the Sequence Diagram, just identifies the changes that need to be done

“UML Diagrams”

  • There’s a new Modeling project in VS2010 that will have all the Diagrams
  • State Diagrams will be supported as well as all other diagrams from UML
  • UML Diagrams supported in this version of VS2010:
    • Use Cases
    • Class Diagram
    • Sequence Diagram
    • Activity Diagram
    • Component Diagram
    • Layer Diagram
      • Very interesting to define the architecture
      • Capability to validate the architecture by doing static code analysis in order to check all the dependencies and references between the several Layers, and defining the architectural problems as errors in the Error List.
      • We can get a visual information regarding the layers that are invalid due to the architectural validation
      • Just for static elements right now, but can be made by extending the pipeline of the Validation of the models


Very interesting Session and a great step for getting real architecture tools inside Visual Studio.

Leave a Reply

Your email address will not be published. Required fields are marked *