Visual Studio 2010 contains features and tools for every actor in Software lifecycle like Architects, Designer, developer and tester. VSTS 2010 Architecture Edition added new features for Architects, which includes the Architecture Explorer to find the relationship between codes, Layer Diagrams to validate the design against the solution Architecture, UML diagrams to represent solution in 4+1 UML model and Model Project to create the Solution Architecture as a Project.

Architecture Explorer is giving the option to understand your code dependencies in and out. Figure 1 shows the Architecture Explorer window. We have the option to analyze our project either in Class View or in Solution View.

Figure 1: Architecture Explorer

Architecture Explorer helps you to visualize the artifacts associated with your solution such as projects, files inside the project, types inside each file, members inside each type, what the members contains and the calls to each method. Figure 2 shows the way we can drill down to a method inside our solution.

Figure 2: Architecture Explorer with Navigation

Not only finding the dependencies and drill down to various details, Architecture Explorer allows you to visualize the relationships in a Matrix view or direct Graph view. Figure 3 shows two different visualizations of our project dependencies in our solution, the matrix view and direct graph view.

Figure 3: Class Diagram - created from the Architecture explorer

We have the options to add more classes or project to the visual representation and to export the DGML graph to a file. Also, we can save the current query as a DGQL query and can be used in future for constructing the same visual representation.

VS 2010 offers the facility to create different types of UML diagrams including Class diagram, sequence diagram, Use case diagram, Activity diagram, Component diagram and layer diagram. For creating any UML diagram, first create a project of type Model Project [New Project type added in VS 2010]. Once the Model Project is created add new item, which allows us to add any of the UML diagrams.Figure 4 shows the diagram types available with VS 2010.

Figure 4: UML diagram supports in VS 2010

Figure 4.1 shows the UML class diagram with two classes and an interface. When you create any of the UML diagrams, we will get the corresponding artifacts in the toolbox. For a class diagram, the toolbox items will be Class, interface, package, association, etc. and for a Use case diagram the artifacts will be Actor, use Case, Dependency, etc.

Figure 4.1: UML class diagram

We can connect the UML diagrams with work items. Also, we can create a new Task or a work item from the UML diagram too. Figure 4.2 shows the options available to connect to Team Foundation Server and create work item from a diagram.

UML Model explorer displays the artifacts defined in the UML diagrams. This will display various classes defined as part of the class diagrams, use cases defined in the use case diagram, etc. It displays the relationships, attributes and operations defined under each artifact.We can re-use the artifacts by drag and drop the artifacts to create a new diagram.Figure 5 shows the UML Model Explorer displaying the artifacts associated with a use case diagram and a class diagram. It also displays the sample class diagram along with Model project structure.

VS 2010 introduced the new feature to generate the Dependency graphs using Directed Graph Markup Language (DGML).If you are joining an enterprise project team with less documentation available; then the dependency graphs feature will help you to understand the project structure with relationships between classes, methods and namespaces. It creates the dependencies between the solution artifacts like namespaces, assemblies, classes and methods. You can define your own custom artifacts to the graph. Figure 6 shows the Generate Dependency Graph with options.

Figure 6: Dependency Graph Options

Figure 7 shows the Dependency Graph generated by Namespace. Look at the red circle on the right top corner, this is the expand button. Once you select the expand button, the Dependency Graph will show the classes/methods inside the current Node.

Figure 7: Dependency Graph - By Namespace

Figure 8 shows the Dependency graph after expanding the ‘WebFormsampleApp’ node. This node consists of classes and other namespaces. ‘GetProductImage’ class is also expanded and displayed the methods inside it - getProductImage, processRequest and get_Isreusable. Once we select any of the nodes, it will display the dependency in the form of an arrow. In figure 8, ProcessRequest method is depends on WebFormsSampleApp.Models namespace and External namespaces.

Layer Diagrams and layer diagram validation is the main architecture feature introduced in VS 2010. Once you define the layers of the solution, we can link the layers with the modules or projects in the solution. Once we define the layers and relationships, then we can validate the solution, whether it follows the architecture or not.

In figure 9, it shows a layer diagram with three layers. The relation between the layers is defined as User Interface layer can talk to Business layer and Business layer can talk to data access layer. If a developer adds any code that refers the data access layer from user interface layer, then it is against the architecture.

We can validate the layer diagram by right click on the diagram and select Validate Architecture option. If the code fails to meet the relationships defined in the diagram, then the validation errors will be thrown.

Visual Studio 2010 released with lot of Architecture features to help the architects to design the solution architecture, present the same using multiple UML diagrams, visualize the existing solution with the help of dependency graphs and Architecture explorer, and even validate their architectures against the code developed by the developers. As the features are integrated with Visual Studio team System, now we have a single platform to architect, design, develop and test our applications.

About the Author

Full Name: Ambily KKMember Level: Silver Member Status: Member,Microsoft_MVP,MVPMember Since: 5/18/2010 1:05:25 AMCountry: India Thanks
Ambily K K
http://ambilykk.com/ http://ambilykk.com/
I have over 9 years of experience working on Microsoft Technologies. I am carrying the passion on Microsoft technologies specifically on web technologies such as ASP .Net and Ajax. My interests also include Office Open XML, Azure, Visual Studio 2010. Technology adoption and learning is my key strength and technology sharing is my passion.