Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Use a Dependency Graph in VS2012 to Understand Your Code Better

DZone's Guide to

Use a Dependency Graph in VS2012 to Understand Your Code Better

· DevOps Zone
Free Resource

The DevOps Zone is brought to you in partnership with Sonatype Nexus. The Nexus Suite helps scale your DevOps delivery with continuous component intelligence integrated into development tools, including Eclipse, IntelliJ, Jenkins, Bamboo, SonarQube and more. Schedule a demo today

Today I came across a new feature called Dependency Graph in Visual Studio 2012. Dependency Graph helps you visualize how your code is written and organized and provide a view on code dependencies. This is very useful when you are working with a code that you have not written. With the dependency graph you can easily get an idea of code written by others in a application. 

How to create Dependency Graph:

You can easily create dependency graph via architecture menu –>Generate Dependency graph. You will also presented to two options like below.
  1. For Solution
  2. For Include file.
HowtoCreateDepencyGraph

I have created a basic web form application and created a dependency graph for entire solution like below.

DepecnyGraphWithWebapplicationVisualStudio2012

Here you can see, I have created a blank template dependency graph and its showing me all reference and class that it has included. 

There are multiple options provide to create graphs and filter graphs like Assembly,Namespace, Interface, Struct, Enumeration, Delegate etc. Once you click on any block it will provide relationship with other block like following.

RealtionShipWithDependencyGraph

There is a option available in solution explorer to create a graph for particular file(s). Like following.

SolutionExplorerDependencyGraph

and once you click new dependency graph it create graph like following.

GraphCreatedFromVisualStudioSolutionExplorer

There are many more features available with dependency graph like analyser etc. I will write about that in future post. Hope you like it. Stay tuned for more. 

The DevOps Zone is brought to you in partnership with Sonatype Nexus. Use the Nexus Suite to automate your software supply chain and ensure you're using the highest quality open source components at every step of the development lifecycle. Get Nexus today

Topics:

Published at DZone with permission of Jalpesh Vadgama, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}