Condividi tramite


Analyze and model your architecture

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Make sure your app meets user requirements by using Visual Studio architecture and modeling tools to design and model your app. Understand existing program code more easily by using Visual Studio to visualize the code's structure, behavior, and relationships.

Create models at different levels of detail throughout the application lifecycle as part of your development process. Track requirements, tasks, test cases, bugs, and other work associated with your models by linking model elements to Team Foundation Server work items and your development plan. See Scenario: Change your design using visualization and modeling.

To see which versions of Visual Studio support each feature, see Version support for architecture and modeling tools

To

Scenario Articles
Visualize code:

- See the code's organization and relationships by creating code maps. Visualize dependencies between assemblies, namespaces, classes, methods, and so on.
- See the class structure and members for a specific project by creating class diagrams from code.
- Find conflicts between your code and its design by creating layer diagrams to validate code.

Note: In this release of Visual Studio, the term code map is used in place of dependency graph. The term graph when used alone generally refers to a Directed Graph or DGML diagram (or document). Code maps are a specialized type of DGML diagram.
- Visualize code
- Working with Classes and Other Types (Class Designer)
- Video: Understand your code dependencies through visualization (Channel 9)
- Video: Visualize the impact of a change (Channel 9)
Describe and communicate user requirements:

- Clarify user stories, business rules, and other requirements and help ensure their consistency by drawing UML diagrams such as use case, activity, and class diagrams.
- Create models for your app
- Model user requirements
- Video: Improve architecture through modeling (Channel 9)
Define the architecture:

- Model the large-scale structure of your software system and the design patterns by drawing UML component, class, and sequence diagrams.
- Define and enforce constraints on dependencies between the components of your code by creating layer diagrams.
- Create models for your app
- Model your app's architecture
- Video: Improve architecture through modeling (Channel 9)
- Video: Use layer diagrams to design and validate your architecture (Channel 9)
Validate your system with the requirements and intended design:

- Define acceptance tests or system tests based on the requirements models. This creates a strong relationship between the tests and your users' requirements and helps you update the system more easily when the requirements change.
- Validate code dependencies with layer diagrams that describe the intended architecture and prevent changes that might conflict with the design.
- Validate your system during development
- Video: Use layer diagrams to design and validate your architecture (Channel 9)
Share models, diagrams, and code maps using Team Foundation version control:

- Put code maps, modeling projects, UML diagrams, and layer diagrams under Team Foundation version control so you can share them.
When you have multiple users who work with these items under Team Foundation version control, use these guidelines to help you avoid version control issues:

- Manage models and diagrams under version control
Generate or configure parts of your application from UML or domain-specific languages:

- Make your design more responsive to requirements changes and easily variable across a product line.
- Generate and configure your app from models
Customize models and diagrams:

- Adapt models to how your project uses them by defining additional properties for UML elements, validation constraints to make sure that your models conform to your business rules, and additional menu commands and toolbox items.
- Create your own domain-specific languages.
- Extend UML models and diagrams
- Modeling SDK for Visual Studio - Domain-Specific Languages
Generate text using T4 templates:

- Use text blocks and control logic inside templates to generate text-based files.
- Code Generation and T4 Text Templates

Types of Models and Their Uses

Model type and typical uses
Code maps

Code maps help you see the organization and relationships in your code.

Typical uses:

- Examine program code so you can better understand its structure and its dependencies, how to update it, and estimate the cost of proposed changes.

See:

- Map dependencies across your solutions
- Use code maps to debug your applications
- Find potential problems using code map analyzers
Layer diagram

Layer diagrams let you define the structure of an application as a set of layers or blocks with explicit dependencies. You can run validation to discover conflicts between dependencies in the code and dependencies described on a layer diagram.

Typical uses:

- Stabilize the structure of the application through numerous changes over its life.
- Discover unintentional dependency conflicts before checking in changes to the code.

See:

- Create layer diagrams from your code
- Layer Diagrams: Reference
- Validate code with layer diagrams
UML model

A UML model includes several views, including class, component, use case, activity, and sequence diagrams. You can customize UML to suit your application domain. For example, you can attach tags, additional information, and constraints to the model elements. You can also define tools that operate on the models. See Create models for your app.

Typical uses:

- Describe requirements and design. You can quickly apply UML to the development of any application. See Use models in your development process.
- Generate or configure tests or parts of an application. Some work is required to customize the notation and develop the generation templates or configurable application. See Generate and configure your app from models.
- For general description and for code generation or configuration in smaller projects.
Domain-specific language (DSL)

A DSL is a notation that you design for a specific purpose. In Visual Studio, it is usually graphical.

Typical uses:

- Generate or configure parts of the application. Work is required to develop the notation and tools. The result can be a better fit to your domain than a UML customization.
- For large projects or in product lines where the investment in developing the DSL and its tools is returned by its use in more than one project.

See:

- Modeling SDK for Visual Studio - Domain-Specific Languages

Where can I get more information?

Resource Links
Forums - Visual Studio Visualization & Modeling Tools
- Visual Studio Visualization & Modeling SDK (DSL Tools)

See Also